diff options
author | Nathan Collins <conathan@galois.com> | 2017-12-11 12:52:55 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-12-11 12:52:56 -0500 |
commit | 6847c6bf5777eaf507f1cef28c1fc75a2c68bdef (patch) | |
tree | d8690c4dba3e31122900b43844ce677a967894d2 /libraries/base/GHC/Base.hs | |
parent | 21be5bde1162c4d006f5eae0f20f9243cb0642f1 (diff) | |
download | haskell-6847c6bf5777eaf507f1cef28c1fc75a2c68bdef.tar.gz |
Improve Control.Monad.guard and Control.Monad.MonadPlus docs
This fixes Issue #12372: documentation for Control.Monad.guard not
useful after AMP.
Reviewers: hvr, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4258
Diffstat (limited to 'libraries/base/GHC/Base.hs')
-rw-r--r-- | libraries/base/GHC/Base.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 052f13fbe6..2d6e0e4195 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -880,15 +880,24 @@ instance Alternative Maybe where -- | Monads that also support choice and failure. class (Alternative m, Monad m) => MonadPlus m where - -- | the identity of 'mplus'. It should also satisfy the equations + -- | The identity of 'mplus'. It should also satisfy the equations -- -- > mzero >>= f = mzero -- > v >> mzero = mzero -- + -- The default definition is + -- + -- @ + -- mzero = 'empty' + -- @ mzero :: m a mzero = empty - -- | an associative operation + -- | An associative operation. The default definition is + -- + -- @ + -- mplus = ('<|>') + -- @ mplus :: m a -> m a -> m a mplus = (<|>) |