Re:Write You a Haskell: Building a modern functional compile...
by purescript on Tuesday January 06, 2015 @12:59PM
(#8845868)
I tried to change the whitespace rules in the PureScript parser to match Haskell recently (to support explicit braces), and it proved to be very difficult. The "L" function which is defined in the Haskell 98 Report depends heavily on an interaction between the lexer and parser, in which a failed parse causes the indenter to behave differently in the lexer. For this reason, I stayed with the simpler rules that we have now, and I plan to support explicit braces in the parser instead.
https://github.com/purescript/purescript/blob/master/src/Lan...
The state is defined in https://github.com/purescript/purescript/blob/master/src/Lan...
(its just the column number). I believe the whitespace rules for Haskell are somewhat subtle, but shouldn't be much harder.