monads-fd 0.1.0.0 → 0.1.0.1
raw patch · 5 files changed
+25/−6 lines, 5 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Control.Monad.Error: noMsg :: (Error a) => a
+ Control.Monad.Error: strMsg :: (Error a) => String -> a
Files
- Control/Monad/Error.hs +1/−1
- Control/Monad/Identity.hs +6/−1
- Control/Monad/State/Class.hs +2/−3
- Control/Monad/Writer/Class.hs +15/−0
- monads-fd.cabal +1/−1
Control/Monad/Error.hs view
@@ -34,7 +34,7 @@ module Control.Monad.Error ( -- * Monads with error handling MonadError(..),- Error,+ Error(..), -- * The ErrorT monad transformer ErrorT(..), mapErrorT,
Control/Monad/Identity.hs view
@@ -33,7 +33,12 @@ -} module Control.Monad.Identity (- module Data.Functor.Identity+ module Data.Functor.Identity,++ module Control.Monad,+ module Control.Monad.Fix, ) where +import Control.Monad+import Control.Monad.Fix import Data.Functor.Identity
Control/Monad/State/Class.hs view
@@ -46,12 +46,11 @@ import Data.Monoid -- ------------------------------------------------------------------------------ | /get/ returns the state from the internals of the monad.------ /put/ replaces the state inside the monad. class (Monad m) => MonadState s m | m -> s where+ -- | Return the state from the internals of the monad. get :: m s+ -- | Replace the state inside the monad. put :: s -> m () -- | Monadic state transformer.
Control/Monad/Writer/Class.hs view
@@ -59,15 +59,30 @@ -- the written object. class (Monoid w, Monad m) => MonadWriter w m | m -> w where+ -- | @'tell' w@ is an action that produces the output @w@. tell :: w -> m ()+ -- | @'listen' m@ is an action that executes the action @m@ and adds+ -- its output to the value of the computation. listen :: m a -> m (a, w)+ -- | @'pass' m@ is an action that executes the action @m@, which+ -- returns a value and a function, and returns the value, applying+ -- the function to the output. pass :: m (a, w -> w) -> m a +-- | @'listens' f m@ is an action that executes the action @m@ and adds+-- the result of applying @f@ to the output to the value of the computation.+--+-- * @'listens' f m = 'liftM' (id *** f) ('listen' m)@ listens :: (MonadWriter w m) => (w -> b) -> m a -> m (a, b) listens f m = do ~(a, w) <- listen m return (a, f w) +-- | @'censor' f m@ is an action that executes the action @m@ and+-- applies the function @f@ to its output, leaving the return value+-- unchanged.+--+-- * @'censor' f m = 'pass' ('liftM' (\\x -> (x,f)) m)@ censor :: (MonadWriter w m) => (w -> w) -> m a -> m a censor f m = pass $ do a <- m
monads-fd.cabal view
@@ -1,5 +1,5 @@ name: monads-fd-version: 0.1.0.0+version: 0.1.0.1 license: BSD3 license-file: LICENSE author: Andy Gill