
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) ------------------------------------------ http://icqsms.cz/

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.

Hi
Is it possible to write multi-line definitions in GHC interactive interpreter ? (like in Python interp. ?)
As it happens, it is possible to do with WinHugs, I've just never turned it on by default. If there is massive need I'll polish this feature up and put it in the next builds. Thanks Neil
participants (3)
-
Dunric
-
Jules Bean
-
Neil Mitchell