On Mon, 2008-11-10 at 16:06 -0600, Derek Elkins wrote: > On Mon, 2008-11-10 at 18:50 +0000, Duncan Coutts wrote: > [...] > > If you meant, why is it allowed rather than banned then I guess the > > answer is because it is orthogonal. The rules naturally handle that case > > and there was no particular reason to ban it, even if it is somewhat > > unusual. > > "Unusual?" This is the motivation of list comprehensions. > > In naive set theory, set comprehensions are one way of an equivalence > between predicates and sets. It's the Cartesian product aspect that > should be considered unusual if anything.
Well, the Cartesian product case is one way of an equivalence between relations and sets of pairs. So I don't think it [ (x, y) | x <- xn, y <- ys ] is any more unusual than [ x | x <- xn ] jcc _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe