producing and consuming lists
Jorge Adriano
jadrian@mat.uc.pt
Wed, 6 Nov 2002 17:48:57 +0000
> > But like I just showed, sometimes paring them may not be a natural
> > approach though...
>
> Yeah, I understand what you mean. In the examples you give, you could
> always try to make the appended stuff (the zs, etc) the same length by
> appending Nothings, but probalby not a general solution.
Yes maybe, I was hoping I could find a more elegant solution though.
> I wonder if, given you original function which returns ([Int],[Int]), y=
ou
> couldn't do something really ugly like using unsafeInterleaveIO on writ=
ing
> the first list, and then write the second list "by hand".
>
> Just a thought.
If "consuming" is just writing stuff to files I think Trace (which uses=20
unsafeInterleaveIO) would be just fine, but "consuming" might be more tha=
n=20
that. In that case I'd have to fuse the functions that consume each of th=
e=20
streams, with the function that produces them.=20
J.A.