[commit: ghc] master: Generalise `guard` for real this time (bf33291)

git at git.haskell.org git at git.haskell.org
Sun Sep 28 10:02:03 UTC 2014


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

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

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

commit bf3329104c971c84ab178f3ded88254b9594f9cc
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sun Sep 28 12:01:13 2014 +0200

    Generalise `guard` for real this time
    
    This was missed in D253 / a07ce1654ac5b8033f2daf9270c6e182415b69ca


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

bf3329104c971c84ab178f3ded88254b9594f9cc
 libraries/base/Control/Monad.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs
index 94318be..619a2ba 100644
--- a/libraries/base/Control/Monad.hs
+++ b/libraries/base/Control/Monad.hs
@@ -87,7 +87,7 @@ import GHC.List ( zipWith, unzip, replicate )
 
 -- | @'guard' b@ is @'pure' ()@ if @b@ is 'True',
 -- and 'empty' if @b@ is 'False'.
-guard           :: (MonadPlus m) => Bool -> m ()
+guard           :: (Alternative f) => Bool -> f ()
 guard True      =  pure ()
 guard False     =  empty
 



More information about the ghc-commits mailing list