summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Base.hs
diff options
context:
space:
mode:
authorNathan Collins <conathan@galois.com>2017-12-11 12:52:55 -0500
committerBen Gamari <ben@smart-cactus.org>2017-12-11 12:52:56 -0500
commit6847c6bf5777eaf507f1cef28c1fc75a2c68bdef (patch)
treed8690c4dba3e31122900b43844ce677a967894d2 /libraries/base/GHC/Base.hs
parent21be5bde1162c4d006f5eae0f20f9243cb0642f1 (diff)
downloadhaskell-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.hs13
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 = (<|>)