RE: The Do-Let-Braces problem

2001-02-15 Thread Simon Marlow
> Mark Utting writes: > > > fb::IO () > > fb = > > do { > > putStr "Enter Data: "; > > line <- getLine; > > let line2 = line; > > putStr line2; > >} > > > > ERROR "f.hs" (line 13): Syntax error in definition > > (unexpected symbol "putStr

Re: The Do-Let-Braces problem

2001-02-15 Thread Paul Hudak
> fb = > do { > putStr "Enter Data: "; > line <- getLine; > let line2 = line; > putStr line2; >} I suggest doing this: > fb = > do { putStr "Enter Data: " >; line <- getLine >; let line2 = line >; putStr line2 >} wh

Re: The Do-Let-Braces problem

2001-02-15 Thread Malcolm Wallace
Mark Utting writes: > fb::IO () > fb = > do { > putStr "Enter Data: "; > line <- getLine; > let line2 = line; > putStr line2; >} > > ERROR "f.hs" (line 13): Syntax error in definition > (unexpected symbol "putStr") I find it hard to de

Re: The Do-Let-Braces problem

2001-02-14 Thread Marcin 'Qrczak' Kowalczyk
Thu, 15 Feb 2001 15:20:19 +1300, Mark Utting <[EMAIL PROTECTED]> pisze: > fb::IO () > fb = > do { > putStr "Enter Data: "; > line <- getLine; > let line2 = line; > putStr line2; >} I have a different proposal. Let's drop the 'let' keyword in value bin

Re: The Do-Let-Braces problem

2001-02-14 Thread Sebastien Carlier
Mark Utting wrote: > Summary: Haskell layout has problems within 'do' (see below). > Can we change Haskell to improve it? I don't think the language has to be changed. It seems to me that the problems is more with the idea of editing the source code as plain text. Ideally, I would like

The Do-Let-Braces problem

2001-02-14 Thread Mark Utting
Summary: Haskell layout has problems within 'do' (see below). Can we change Haskell to improve it? We teach Haskell to all our second-year students, and we like to teach the OPTION of using explicit braces and ;'s. (If students write nested do constructs, even though we discourage t