Hi

> > passall, passany :: [a -> Bool] -> a -> Bool
> > passall ps v = and $ map ($v) ps
> > passany ps v = or $ map ($v) ps
>
> or something similar defined anywhere? Such that one can write

Don't think so.

One thing I have often wanted is something like:

or1 a b x = a x || b x
or2 a b x y = a x y || b x y

Then you can do:

filter ((>5) `or1` odd) [0..10]
filter ((>5) `and1` odd) [0..10]

You can imagine that or1 could get a symbol such as ||#, and or2 could
perhaps be ||## (if # wasn't already really overloaded)

Thanks

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

Reply via email to