* Rijk J. C. van Haaften <[EMAIL PROTECTED]> [2003-01-30 12:06 +0100]:
> >* Rijk J. C. van Haaften <[EMAIL PROTECTED]> [2003-01-30 11:41 +0100]: > > > >> Recently, I came accross this expression: > >> [ x + y | x <- xs | y <- ys ] > > ^ > > Put a comma ',' here. > That's something totally different. Two examples: > 1. Comma > [ x + y | x <- [1,2], y <- [3,4] ] > = [4,5,5,6] > 2. Bar > [ x + y | x <- [1,2] | y <- [3,4] ] > = [ x + y | (x,y) <- zip [1,2] [3,4] ] > = zipWith (+) [1,2] [3,4] > = [4,6] > The first is according to the standard. No problems so far. > However, I couldn't find a description of the semantics of > the second (and it is clearly non-standard), though I think > the semantics given above using zip and zipWith are correct. Ok, I see. Sorry, this was just my first thought. Unfortunately I cannot help you with the Bar thing. Regards, Olli -- obraun@ -+-[ informatik.unibw-muenchen.de ]-+-[ IIS _ INF _ UniBwM ] |-[ FreeBSD.org ]-+-[ FreeBSD Commmitter ] |-[ unsane.org ]-+-[ everything __ else ]
msg02492/pgp00000.pgp
Description: PGP signature