diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-04 11:15:51 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-11-04 11:15:51 +0100 |
commit | c7fa0ba69c1d28e874d811535447838910810c6f (patch) | |
tree | 4bffd554e3fa80c621a05d1633474520a73624ea /libraries/base | |
parent | 828d72489a8bad79e3675deed4b90807052ca0ee (diff) | |
download | haskell-c7fa0ba69c1d28e874d811535447838910810c6f.tar.gz |
Fix lost Haddock annotation for `class Monad m`
This was broken in d94de87252d0fe2ae97341d186b03a2fbe136b04 when `join`
was inserted between `Monad`'s Haddock string and the `class Monad m`
definition thereby breaking the association.
Diffstat (limited to 'libraries/base')
-rw-r--r-- | libraries/base/GHC/Base.lhs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libraries/base/GHC/Base.lhs b/libraries/base/GHC/Base.lhs index f9d01b5269..d3959359b2 100644 --- a/libraries/base/GHC/Base.lhs +++ b/libraries/base/GHC/Base.lhs @@ -416,6 +416,12 @@ liftA2 f a b = (fmap f a) <*> b liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d liftA3 f a b c = (fmap f a) <*> b <*> c +-- | The 'join' function is the conventional monad join operator. It +-- is used to remove one level of monadic structure, projecting its +-- bound argument into the outer level. +join :: (Monad m) => m (m a) -> m a +join x = x >>= id + {- | The 'Monad' class defines the basic operations over a /monad/, a concept from a branch of mathematics known as /category theory/. From the perspective of a Haskell programmer, however, it is best to @@ -438,13 +444,6 @@ Instances of both 'Monad' and 'Functor' should additionally satisfy the law: The instances of 'Monad' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO' defined in the "Prelude" satisfy these laws. -} - --- | The 'join' function is the conventional monad join operator. It --- is used to remove one level of monadic structure, projecting its --- bound argument into the outer level. -join :: (Monad m) => m (m a) -> m a -join x = x >>= id - class Applicative m => Monad m where -- | Sequentially compose two actions, passing any value produced -- by the first as an argument to the second. |