Let in do-expressions

Martin Erwig erwig@cs.orst.edu
Thu, 15 Feb 2001 11:23:05 -0800


Hi there,

I am trying to use the "let"-notation within do-expressions,
and it seems to me that it does not work correctly. (I am using
Hugs, version February 2000, on Solaris.)

E.g.,

  do {x <- [1..9]; let i=1 in do {return ((+i) x)}}

works as expected, but with

  do {x <- [1..9]; let i=1; return ((+i) x)}

I get:

  ERROR: Syntax error in definition (unexpected symbol "i")

According to the Report (Section 3.14) the latter expression
should be a valid abbreviation of the former, or am I missing
something here? If it is a bug, has it been corrected in the
new version of Hugs?


Thanks,
Martin