2007/7/4, Michael Vanier <[EMAIL PROTECTED]>:
That's cool -- good point.  takeWhile is also trivially defined in terms of 
foldr:

 > takeWhile p = foldr (\x r -> if p x then x:r else []) []

Can you do dropWhile in terms of foldr?  I don't see how.


I 'm very bad in english, sorry.

Here is a solution....
dropWhile in terms of fordr

Author : Graham Hutton
www.cs.nott.ac.uk/~gmh/fold.ps
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to