Stephen Tetley wrote:
Hi Andrew
"Spot the difference"
data Property x y = forall s. Property s (x -> s -> s) (s -> y)
data Fold b c = forall a. F (a -> b -> a) a (a -> c)
The later is from:
http://squing.blogspot.com/2008/11/beautiful-folding.html
Max Rabkin's is is closer to the original argument ordering of foldl.
Hmm. So somebody else has come up with the exact same solution to the
same problem.
My problem isn't exactly the same though. I'm interested in computing a
"property" of a list, and recomputing it as elements are appended to the
list. My "Property" structure provides an efficient way to do this, and
to do so composibly. (E.g., if I want the maximum of the mean or
something. Maximum and mean are both folds.)
PS. Epic, epic comment spam.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe