GHC support for the new "record" package

Simon Marlow marlowsd at gmail.com
Tue Jan 20 21:44:37 UTC 2015


For those who haven't seen this, Nikita Volkov proposed a new approach 
to anonymous records, which can be found in the "record" package on 
Hackage: http://hackage.haskell.org/package/record

It had a *lot* of attention on Reddit: 
http://nikita-volkov.github.io/record/

Now, the solution is very nice and lightweight, but because it is 
implemented outside GHC it relies on quasi-quotation (amazing that it 
can be done at all!).  It has some limitations because it needs to parse 
Haskell syntax, and Haskell is big.  So we could make this a lot 
smoother, both for the implementation and the user, by directly 
supporting anonymous record syntax in GHC.  Obviously we'd have to move 
the library code into base too.

This message is by way of kicking off the discussion, since nobody else 
seems to have done so yet.  Can we agree that this is the right thing 
and should be directly supported by GHC?  At this point we'd be aiming 
for 7.12.

Who is interested in working on this?  Nikita?

There are various design decisions to think about.  For example, when 
the quasi-quote brackets are removed, the syntax will conflict with the 
existing record syntax.  The syntax ends up being similar to Simon's 
2003 proposal 
http://research.microsoft.com/en-us/um/people/simonpj/Haskell/records.html 
(there are major differences though, notably the use of lenses for 
selection and update).

I created a template wiki page:
https://ghc.haskell.org/trac/ghc/wiki/Records/Volkov

Cheers,
Simon


More information about the ghc-devs mailing list