That seems extremely reasonable.  I propose to treat it as
a Haskell98 typo; it doesn't change the meaning of the language
as described by the current report, since no meaning is given
to do {} and friends.

Does anyone think there is a reason *not* to do this?

Simon



> -----Original Message-----
> From: Ross Paterson 
> Sent: Monday, July 26, 1999 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: Haskell 98 Report: do expression syntax
> 
> 
> The Haskell 98 Report has (in 3.14):
> 
>   exp   -> do { stmts }         (do expression)
>   stmts -> stmt1 ; ... ; stmtn  (n>=0)
>   stmt  -> exp
>         |  pat <- exp
>         |  let decls
>         |  (empty statment)
> 
> which allows the following:
> 
>         do {}
>         do {let x = 5}
>         do {x <- return 5}
> 
> However the translation rules require that the last non-empty stmt
> be an exp, which seems very sensible.  I suggest
> 
>   exp   -> do { body }                  (do expression)
>   body  -> stmt1 ; ... stmtn ; exp {;}  (n>=0)
> 


Reply via email to