[Haskell-cafe] GHCi and multi-line support ?

Jules Bean jules at jellybean.co.uk
Mon Feb 19 08:14:04 EST 2007


Dunric wrote:
> Is it possible to write multi-line definitions in GHC interactive interpreter ? (like in Python interp. ?)
>
> When I try to write f.E. if-then-else in more then 1 line I get the following error:
> <interactive>:1:30: parse error (possibly incorrect indentation)
>   

It would be quite hard to do this with the layout rule, since the nature 
of the layout rule is that you don't know if the definition is complete 
until you read the next line. So you don't know whether or not to 
execute it yet...

With explicit notation {}, and friends, I don't see a technical reason 
not to. I just write long definitions though.




More information about the Haskell-Cafe mailing list