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