On Tue, May 12, 2009 at 1:39 PM, Roman Leshchinskiy <r...@cse.unsw.edu.au> wrote: > let xs = map f ys in (sum xs, product xs) > > the elements of xs will be computed once if it is a list but twice if it is > a stream.
If you're using lists for loops rather than data, that's what you want (what you probably really want is cfoldl' ((,) <$> sumF <*> productF) xs, in terms of combinable folds). > Roman --Max _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe