[Haskell-cafe] Re: List comprehension desugaring

2007-08-19 Thread Neil Mitchell
Hi

Sorry for the noise, I've now realised they are a left to right
rewrite system, the second rule is required to set up the base case.

Thanks

Neil

On 8/19/07, Neil Mitchell [EMAIL PROTECTED] wrote:
 Hi,

 The Haskell desugaring for list comprehensions is given in:

 http://haskell.org/onlinereport/exps.html#list-comprehensions

 All the rules seem to be left to right rewrites, apart from the second
 one, which seems to be right to left. Is there some deep reason for
 this, or is this accidental.

 Thanks

 Neil

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


[Haskell-cafe] Re: List comprehension desugaring

2007-08-19 Thread apfelmus

Neil Mitchell wrote:

The Haskell desugaring for list comprehensions is given in:

http://haskell.org/onlinereport/exps.html#list-comprehensions

All the rules seem to be left to right rewrites, apart from the second
one, which seems to be right to left. Is there some deep reason for
this, or is this accidental.


Isn't the second rule left to right, too? The translation assumes that Q 
is non-empty, so the three last rules don't match [e | q] but they match 
[e | q, True]. The non-emptiness is probably for ruling out the invalid 
list comprehension [e | ] which would otherwise appear as an 
intermediate result in the translation for empty Q.


Regards,
apfelmus

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