[Haskell-cafe] Fold that quits early?

Andrew Wagner wagner.andrew at gmail.com
Sat Jan 24 11:39:13 EST 2009

This is almost a fold, but seemingly not quite? I know I've seem some talk
of folds that potentially "quit" early. but not sure where I saw that, or if
it fits.

f xs [] = False
f xs (y:ys) | any c ys' = True
            | otherwise = f (nub (y:xs)) (ys' ++ ys)
   where ys' = g y xs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090124/50a8ba93/attachment.htm

More information about the Haskell-Cafe mailing list