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.)



Attachment: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to