Wouter Swierstra <[EMAIL PROTECTED]> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to