monadplus 1.4 → 1.4.1
raw patch · 2 files changed
+6/−6 lines, 2 files
Files
- monadplus.cabal +1/−1
- src/Control/Monad/Plus.hs +5/−5
monadplus.cabal view
@@ -1,6 +1,6 @@ name: monadplus-version: 1.4+version: 1.4.1 cabal-version: >= 1.10 author: Hans Hoglund maintainer: Hans Hoglund <hans@hanshoglund.se>
src/Control/Monad/Plus.hs view
@@ -1,8 +1,5 @@ -{-# LANGUAGE DeriveFunctor, DeriveFoldable, GeneralizedNewtypeDeriving,-- TypeSynonymInstances- #-}+{-# LANGUAGE DeriveFunctor, DeriveFoldable, GeneralizedNewtypeDeriving #-} ------------------------------------------------------------------------------------- -- |@@ -229,7 +226,10 @@ instance Monad (Partial r) where return x = Partial (\_ -> Just x)- Partial f >>= k = Partial $ \r -> f r >>= \x -> getPartial (k x) r+ Partial f >>= k = Partial $ \r -> do { x <- f r; getPartial (k x) r }+ -- f >>= k = (join' . fmap k) f+ -- where+ -- join' g = Partial $ \x -> do { h <- getPartial g x; getPartial h x } instance MonadPlus (Partial r) where mzero = Partial (const Nothing)