How does GHC implement layout?

Alexis King lexi.lambda at
Tue Apr 6 00:35:59 UTC 2021

On 4/5/21 2:36 PM, Ian Lynagh wrote:
> It was originally designed by John Meacham: 

Thanks, Ian—I had stumbled across a link to the old Haskell Prime trac 
wiki while I was searching for information, but I didn’t realize where 
it had been migrated to.

> It isn't exactly equivalent to the Haskell layout rule, but it's 
> fairly close and much simpler (due to not having the "on a parse 
> error" case).

Yes, I gathered as much from the implementation. The idea makes sense, 
but of course it doesn’t provide much benefit to have a simpler 
implementation unless it actually /replaces/ the “on parse error” approach.

Given this appears to be a long-defunct proposal, a natural followup 
question is to ask whether there’s any reason this code is still in GHC. 
Is it used for any purpose, or could it be removed?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list