GHC support for the new "record" package

Christopher Done chrisdone at gmail.com
Wed Jan 28 21:26:19 UTC 2015


There’s too much to absorb in this discussion at the moment and I’m
late to the party anyway, but I would like to make a small note on
syntax. Given that this is very similar to TRex both in behaviour and
syntactic means of construction, why not just take TRex’s actual
syntax? http://en.wikipedia.org/wiki/Hugs#Extensible_records

type Point2D = Rec (x::Coord, y::Coord)
point2D = (x=1, y=1) :: Point2D
(#x point)

It seems like it wouldn’t create any syntactical ambiguities (which is
probably why the Hugs developers chose it).

Ciao

On 20 January 2015 at 22:44, Simon Marlow <marlowsd at gmail.com> wrote:
> 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
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs


More information about the ghc-devs mailing list