X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FMonad.hs;h=7d43db941bbcd4ba998a874f22d26b3ffab20a9f;hb=95551d95988646a16ed4550f403ee4c27884a292;hp=8972ca181fc9fa13d3738ca97ee795adbd88c81f;hpb=08cf6c12a472eecb7613842dffa2ed728d162adb;p=ghc-base.git diff --git a/Control/Monad.hs b/Control/Monad.hs index 8972ca1..7d43db9 100644 --- a/Control/Monad.hs +++ b/Control/Monad.hs @@ -28,7 +28,7 @@ module Control.Monad -- ** Naming conventions -- $naming - -- ** Basic functions from the "Prelude" + -- ** Basic @Monad@ functions , mapM -- :: (Monad m) => (a -> m b) -> [a] -> m [b] , mapM_ -- :: (Monad m) => (a -> m b) -> [a] -> m () @@ -183,7 +183,7 @@ infixr 1 <=<, >=> (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> (a -> m c) f >=> g = \x -> f x >>= g --- | Right-to-left Kleisli composition of monads. '(>=>)', with the arguments flipped +-- | Right-to-left Kleisli composition of monads. @('>=>')@, with the arguments flipped (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> (a -> m c) (<=<) = flip (>=>) @@ -220,7 +220,7 @@ zipWithM_ f xs ys = sequence_ (zipWith f xs ys) {- | The 'foldM' function is analogous to 'foldl', except that its result is encapsulated in a monad. Note that 'foldM' works from left-to-right over -the list arguments. This could be an issue where '(>>)' and the `folded +the list arguments. This could be an issue where @('>>')@ and the `folded function' are not commutative.