
22 May
2009
22 May
'09
3:01 p.m.
On May 22, 2009, at 4:13 AM, Jason Dusek wrote:
I'd like to know what folks think about the use of `MonadPlus` in this case.
The |guard| function is almost |filter|:
import Control.Monad ( MonadPlus, guard )
filter :: MonadPlus m => (a -> Bool) -> m a -> m a filter p m = do a <- m guard (p a) return a
Cheers, Sebastian -- Underestimating the novelty of the future is a time-honored tradition. (D.G.)