[Haskell-cafe] Stream-fusion without the lists
ryani.spam at gmail.com
Tue May 12 16:16:43 EDT 2009
Sure, but this definition leaks space, which I think is one of the
points that Reiner made.
On Tue, May 12, 2009 at 5:39 AM, Roman Leshchinskiy <rl at cse.unsw.edu.au> wrote:
> On 12/05/2009, at 14:45, Reiner Pope wrote:
>> The Stream datatype seems to be much better suited to representing
>> loops than the list datatype is. So, instead of programming with the
>> lists, why don't we just use the Stream datatype directly?
> I think the main reason is that streams don't store data and therefore don't
> support sharing. That is, in
> 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.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe