> On the other hand, I think that the pat=expr syntax was something of a
> design error and it may not be supported in future releases. Judging from
> email that I've received, the similarity of == and = does cause confusion.
> In fact, it has also caught me on at least one occassion! (So yes, my
> experience is somewhat at odds with Nikhil's here.) As a result, Gofer 2.28
> supports an alternative (and more general) syntax, with qualifiers of the
> form let {decls} and a semantics given by:
>
> [ e | let { decls } ] = [ let { decls } in e ]
>
> Parsing this doesn't cause any conflicts with standard Haskell syntax (as far
> as I can tell), and the braces can usually be omitted so there isn't a big
> syntactic overhead.
Parsing Haskell list comprehensions deterministically ((LA)LR) is currently very
hard, since both "pat <- exp" (or also "pat gd <- exp", as suggested by Thomas)
and "exp" are allowed as qualifiers in a list comprehension. Patterns and
expressions can look very much alike. Could one possibly expand "exp" to
"if exp" in Haskell 1.3 list comprehensions? Only to make deterministic
parsing easier...
/kent k