writer-cps-transformers 0.1.0.1 → 0.1.0.2
raw patch · 3 files changed
+46/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Control/Monad/Trans/RWS/CPS.hs +18/−0
- Control/Monad/Trans/Writer/CPS.hs +25/−1
- writer-cps-transformers.cabal +3/−3
Control/Monad/Trans/RWS/CPS.hs view
@@ -5,6 +5,24 @@ #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE AutoDeriveTypeable #-} #endif+-----------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.RWS.CPS+-- Copyright : (c) Daniel Mendler 2016,+-- (c) Andy Gill 2001,+-- (c) Oregon Graduate Institute of Science and Technology, 2001+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : mail@daniel-mendler.de+-- Stability : experimental+-- Portability : portable+--+-- A monad transformer that combines 'ReaderT', 'WriterT' and 'StateT'.+-- This version uses continuation-passing-style for the writer part+-- to achieve constant space usage. This transformer can be used as a+-- drop-in replacement for Control.Monad.Trans.RWS.Strict/Lazy.+-----------------------------------------------------------------------------+ module Control.Monad.Trans.RWS.CPS ( -- * The RWS monda RWS,
Control/Monad/Trans/Writer/CPS.hs view
@@ -5,6 +5,30 @@ #if __GLASGOW_HASKELL__ >= 710 {-# LANGUAGE AutoDeriveTypeable #-} #endif+-----------------------------------------------------------------------------+-- |+-- Module : Control.Monad.Trans.Writer.CPS+-- Copyright : (c) Daniel Mendler 2016,+-- (c) Andy Gill 2001,+-- (c) Oregon Graduate Institute of Science and Technology, 2001+-- License : BSD-style (see the file LICENSE)+--+-- Maintainer : mail@daniel-mendler.de+-- Stability : experimental+-- Portability : portable+--+-- The strict 'WriterT' monad transformer, which adds collection of+-- outputs (such as a count or string output) to a given monad.+--+-- This monad transformer provides only limited access to the output+-- during the computation. For more general access, use+-- "Control.Monad.Trans.State" instead.+--+-- This version builds its output strictly and uses continuation-passing-style+-- to achieve constant space usage. This transformer can be used as a+-- drop-in replacement for Control.Monad.Trans.Writer.Strict/Lazy.+-----------------------------------------------------------------------------+ module Control.Monad.Trans.Writer.CPS ( -- * The Writer monad Writer,@@ -109,7 +133,7 @@ {-# INLINE mapWriterT #-} instance Functor m => Functor (WriterT w m) where- fmap f m = WriterT $ \w -> (\(a, w) -> (f a, w)) <$> unWriterT m w+ fmap f m = WriterT $ \w -> (\(a, w') -> (f a, w')) <$> unWriterT m w {-# INLINE fmap #-} instance (Functor m, Monad m) => Applicative (WriterT w m) where
writer-cps-transformers.cabal view
@@ -3,8 +3,8 @@ -- see: https://github.com/sol/hpack name: writer-cps-transformers-version: 0.1.0.1-license: MIT+version: 0.1.0.2+license: BSD3 license-file: LICENSE tested-with: GHC == 7.0.4, GHC == 7.2.2, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 author: Andy Gill, Ross Paterson, Daniel Mendler@@ -14,7 +14,7 @@ category: Control homepage: https://github.com/minad/writer-cps-transformers#readme synopsis: WriteT and RWST monad transformers-description: The WriterT and RWST monad transformers provided by writer-cps-transformers are written in continuation passing style and avoid the space-leak problem of the traditional Control.Monad.Trans.Writer.Strict/Lazy.+description: The WriterT and RWST monad transformers provided by writer-cps-transformers are written in continuation passing style and avoid the space-leak problem of the traditional Control.Monad.Trans.Writer.Strict/Lazy. The corresponding MTL class instances are in the package writer-cps-mtl (<https://hackage.haskell.org/package/writer-cps-mtl>). build-type: Simple cabal-version: >= 1.10