The documentation says:
GHCi also has a multi-line mode, enabled: set + m, in which GHCi automatically detects when the current statement is not completed, and allows you to add additional lines. Multi-line input ends with an empty string.
Multiline mode makes GHCi very similar, for example. Python interpreter:
Prelude> :set +m Prelude> let x = 1 Prelude| y = 2 Prelude| z = 3 Prelude| Prelude> (x, y, z) (1,2,3)
This hidden gem is great for playing with readable code!
If you want this to be the default behavior, you can create a .ghci file in your home directory using the line :set +m . (Now that it has come, I actually did it.)
source share