Even if you cannot enter multi-line statements into hugs in this case it is possible to do it all in one line.
You can use two let ... in ... like this:
let x = 1 in let z = x+y in z + 1
or you can use ; for multiple definitions like this:
let x=1; z=x+y in z + 1
1
ErikR
On
(Sorry - didn't realize your question was about hugs not ghci.)
You can use :{ in ghci to enter a multiline expression:
shell$ ghci
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Prelude> :{
Prelude| let z = 1
Prelude| w = 3
Prelude| in z + w
Prelude| :}
4
Prelude>
Even if you cannot enter multi-line statements into hugs in this case it is possible to do it all in one line.
You can use two
let ... in ...like this:or you can use
;for multiple definitions like this: