> Does it mean that the following expressions would be illegal?
> 
> if cond then do proc1; proc2 else do proc3; proc4
> (case e of Just x -> x > 0; Nothing -> False)

Unfortunately, yes.

> Now one can forget about {} and use layout everywhere. He would no
> longer be able to forget or he would have to split some expressions
> into indented lines, even when they are unambiguous in one line.
> 
> 
> Hmm, the `do x == y == z' case is a real trouble. Would it be not
> too ugly to formalize the current common behavior as something like
> "for the purposes of layout resolution, the syntax does not care
> about fixity declarations"? I guess that treating them in any way at
> this stage, as long as they don't reject non-associative operators,
> would yield the same result... Ugly but practical.

One other possible solution is to remove the fixity resolution from the
grammar itself and describe it as a separate process post-parsing.  This is
probably a good thing anyway: it matches the way most implementations work
and it would clean up the grammar.

Cheers,
        Simon


Reply via email to