I really like this proposal (except I would bike shed about the syntax for record selector to be dot, like in the majority of languages.)

In other languages dot is a binary operator, so that r.x selects the x field from record r.

 

In this proposal #x is a unary operator (more of a lexical modifier really), which returns a first-class composable value for the field.  Only later does it meet a record.  This is a big difference.  

 

(Moreover, debating dot has proved a graveyard for previous discussions.)

 

I’m glad you like the base proposal.

 

Simon

 

From: Johan Tibell [mailto:johan.tibell@gmail.com]
Sent: 24 January 2015 01:05
To: Simon Peyton Jones
Cc: Adam Gundry; Iavor Diatchki; Simon Marlow; ghc-devs@haskell.org
Subject: Re: GHC support for the new "record" package

 

I really like this proposal (except I would bike shed about the syntax for record selector to be dot, like in the majority of languages.)

 

On Fri, Jan 23, 2015 at 3:41 PM, Simon Peyton Jones <simonpj@microsoft.com> wrote:

| I just
| noticed that it effectively gives us a syntax for identifier-like Symbol
| singletons, which could be useful in completely different contexts

Indeed so.  I have written a major increment to
https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Redesign
which people reading this thread may find interesting.  Look for "Plan B".

For the first time I think I can see a nice, simple, elegant, orthogonal story.

Simon

_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs