[commit: ghc] master: Fix lost Haddock annotation for `class Monad m` (c7fa0ba)

git at git.haskell.org git at git.haskell.org
Tue Nov 4 10:17:32 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/c7fa0ba69c1d28e874d811535447838910810c6f/ghc

>---------------------------------------------------------------

commit c7fa0ba69c1d28e874d811535447838910810c6f
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Tue Nov 4 11:15:51 2014 +0100

    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.


>---------------------------------------------------------------

c7fa0ba69c1d28e874d811535447838910810c6f
 libraries/base/GHC/Base.lhs | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/libraries/base/GHC/Base.lhs b/libraries/base/GHC/Base.lhs
index f9d01b5..d395935 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.



More information about the ghc-commits mailing list