darcs patch: Add justIf to Data.Maybe

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Aug 26 17:16:24 EDT 2009


On Wed, 2009-08-26 at 18:58 +0100, Jon Fairbairn wrote:

> > It's not that hard to write
> > 
> >      all_spaces xs = checkA (all (isSpace xs)) xs
> > 
> > if that's really what you want.
> 
> Not /hard/, but it involves using xs twice, which should tell us
> something.

I'm not sure it does tell us much, given that there are also cases where
we need to use it only once, and would be forced to use \_ -> to ignore
it in the predicate.

The two forms are clearly inter-convertible and one form is more
convenient in some situations while the other is more convenient in
others.

Duncan



More information about the Libraries mailing list