On Jan 18, 2008 1:46 AM, Isaac Dupree <[EMAIL PROTECTED]> wrote:
> Neil Mitchell wrote:
> > 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
>
> nearly; using Prelude:
> passall ps v = all ($v) ps
> passany ps v = any ($v) ps

See also <http://haskell.org/haskellwiki/Pointfree#Swing>, which would
let you define

  passall = swing all
  passany = swing any

Whether that's any better than the pointwise version is up to you.


Stuart
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to