On Wed, 30 Jan 2002, Bernard James POPE wrote:
(snip)
> when             :: (Monad m) => Bool -> m () -> m ()
> when p s          = if p then s else return ()
>
> unless           :: (Monad m) => Bool -> m () -> m ()
> unless p s        = when (not p) s
(snip)

That's cute. People post all sorts of handy little code fragments here.
Does anyone collect them together into a sort of "here's some useful stuff
that's worth looking at" library?

-- Mark


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to