Simon Marlow wrote:
> 
> > 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.

You could just enumerate all keywords that allow/enforce insertion of }.
A suitable list for Haskell 98 might be:

        in
        where
        )
        ]
        module
        type
        data
        newtype
        class
        instance
        default

In fact I think that this would be the cleanest and simplest rule. (At
least that is how I once implemented layout similar to Haskell's,
because I couldn't get Yacc's error productions to work properly in all
cases).

For Haskell 2(000) I would suggest removing all but the first 4 tokens
from the list above.

        - Andreas

-- 
Andreas Rossberg, [EMAIL PROTECTED]

:: be declarative. be functional. just be. ::


Reply via email to