like [(x, y) | x <- xs | y <- ys], and it's not clear how to define
"zip" for a monad - but perhaps there is some extension of a monad
where it makes sense?

Well, I question that the above notation makes sense (for lists).
It is trying to be too clever.

"standard" list comprehensions  at least are consistent
with mathematical notation for sets. (That is,
they are putting the cart before the horse consistently.)

But could you show the above code example to some non-ghc-aware person
and expect her to guess the meaning correctly?  I think not.

And even if, the implied zip is dangerous because it does not
complain about unequal lengths, and you cannot guess that either.
If you write  (x,y) <- zip xs ys  instead then at least you know
that you need to lookup the definition of zip.

Best regards, J.W.



Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to