darcs patch: Add justIf to Data.Maybe
Joachim Breitner
mail at joachim-breitner.de
Sat Aug 22 06:14:38 EDT 2009
Hi,
Am Samstag, den 22.08.2009, 10:13 +0100 schrieb Jon Fairbairn:
> Joachim Breitner <mail at joachim-breitner.de> writes:
> > I propose the attached change, with a discussion timeframe until end of
> > September. The corresponding ticket is
> > http://hackage.haskell.org/trac/ghc/ticket/3446
> >
> > Thanks,
> > Joachim
>
> I have been meaning to get round to proposing check for Data.Monad:
>
> > check :: (MonadPlus m) => (a -> Bool) -> a -> m a
> > check p a
> > | p a = return a
> > | otherwise = mzero
>
> Now justIf = flip (check . const)
>
> So I suggest that it would be better to add check first(, and then
> possibly switch the order of arguments to justIf).
are you proposing that, if check is available, no justIf is needed in
the libraries? Or are you just proposing a different implementation?
Greetings,
Joachim
--
Joachim Breitner
e-Mail: mail at joachim-breitner.de
Homepage: http://www.joachim-breitner.de
ICQ#: 74513189
Jabber-ID: nomeata at joachim-breitner.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.haskell.org/pipermail/libraries/attachments/20090822/3f5d2ad5/attachment.bin
More information about the Libraries
mailing list