[Haskell-cafe] ANNOUNCE: The Monad.Reader - Issue 6

Pixel pixel at mandriva.com
Wed Jan 31 17:02:19 EST 2007


Wouter Swierstra <wss at Cs.Nott.AC.UK> writes:

> * Bernie Pope - Getting a Fix from the Right Fold

i ended up with this one:

dwBool predicate l = (foldr combine (\_ -> []) l) True
    where 
      combine e fl beg = if beg && predicate e 
                         then fl True 
                         else e : fl False

higher-order, like solutions 3 & 4, but simpler IMO :p


More information about the Haskell-Cafe mailing list