Parallel list comprehensions
Jon Fairbairn
jf at cl.cam.ac.uk
Sat Feb 4 13:31:56 EST 2006
On 2006-02-04 at 15:11+0100 John Hughes wrote:
> I noticed ticket #55--add parallel list comprehensions--which according to
> the ticket, will probably be adopted. I would argue against.
I also agree.
> Firstly: because in its more general forms the notation is confusing. Try
> this example:
>
> [(i,j,k) | i<-[1..3], j<-[1..3] | k <- [1..9]]
>
> In general it's hard to predict how the elements from each
> set of generators and filters will match up.
and I always think it's going to do something cooler -- a
"fair" list product (like "," only working on infinite lists),
not a zip, and then I'm disappointed when I remember it
doesn't. So it just uses up some syntax (ie adds possible
errors) without adding anything really useful.
There ought to be a list_product somewhere (I mean [1..]
`list_product` [4..] ==
[(1,4),(2,4),(1,5),(3,4),(2,5),(1,6),...]). Is there?
Jón
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
More information about the Haskell-prime
mailing list