OverloadedRecordFields status update

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OverloadedRecordFields status update

Adam Gundry
Hi ghc-devs,

I have been working on a new extension, OverloadedRecordFields, and it
is now essentially feature-complete. Unfortunately, I doubt it will make
it into 7.8, as the changes are quite extensive, but I hope to get it in
HEAD soon thereafter.

I would really appreciate comments on the design [1], for which there is
a prototype implementation [2] that works in GHC 7.6.3. If you'd like to
review the code, you can check out the overloaded-record-fields branch
from the Github repositories [3, 4], and there are notes on the
implementation on the wiki [5].

Thanks!

Adam

[1] http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan
[2] https://github.com/adamgundry/records-prototype
[3] https://github.com/adamgundry/ghc
[4] https://github.com/adamgundry/packages-base
[5]
http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Implementation



Reply | Threaded
Open this post in threaded view
|

OverloadedRecordFields status update

Gabor Greif-2
On 9/5/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:
> Hi ghc-devs,
>
> I have been working on a new extension, OverloadedRecordFields, and it
> is now essentially feature-complete. Unfortunately, I doubt it will make
> it into 7.8, as the changes are quite extensive, but I hope to get it in
> HEAD soon thereafter.

That would be great, it appears to be a great example of
-XConstraintKinds, too!

>
> I would really appreciate comments on the design [1], for which there is

How would such a feature interact with
http://hackage.haskell.org/package/vinyl ?

    Gabor

> a prototype implementation [2] that works in GHC 7.6.3. If you'd like to
> review the code, you can check out the overloaded-record-fields branch
> from the Github repositories [3, 4], and there are notes on the
> implementation on the wiki [5].
>
> Thanks!
>
> Adam
>
> [1]
> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan
> [2] https://github.com/adamgundry/records-prototype
> [3] https://github.com/adamgundry/ghc
> [4] https://github.com/adamgundry/packages-base
> [5]
> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Implementation
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>



Reply | Threaded
Open this post in threaded view
|

OverloadedRecordFields status update

Adam Gundry
On 06/09/13 17:45, Gabor Greif wrote:
> On 9/5/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:
>>
>> I have been working on a new extension, OverloadedRecordFields, and it
>> is now essentially feature-complete. Unfortunately, I doubt it will make
>> it into 7.8, as the changes are quite extensive, but I hope to get it in
>> HEAD soon thereafter.
>
> That would be great, it appears to be a great example of
> -XConstraintKinds, too!

It relies quite heavily on type-level strings (-XDataKinds), if that's
what you mean?


>> I would really appreciate comments on the design [1], for which there is
>
> How would such a feature interact with
> http://hackage.haskell.org/package/vinyl ?

The short answer is that it shouldn't. Vinyl (which I wasn't aware of
before now, thanks for the pointer!) basically replaces the Haskell
records system wholesale, making records entirely separate from data
declarations, and turning fields into first-class objects. This should
peaceably coexist with -XOverloadedRecordFields but I don't see a way to
integrate the two.

Adam


>     Gabor
>
>> a prototype implementation [2] that works in GHC 7.6.3. If you'd like to
>> review the code, you can check out the overloaded-record-fields branch
>> from the Github repositories [3, 4], and there are notes on the
>> implementation on the wiki [5].
>>
>> Thanks!
>>
>> Adam
>>
>> [1]
>> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan
>> [2] https://github.com/adamgundry/records-prototype
>> [3] https://github.com/adamgundry/ghc
>> [4] https://github.com/adamgundry/packages-base
>> [5]
>> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Implementation




Reply | Threaded
Open this post in threaded view
|

OverloadedRecordFields status update

Gabor Greif-2
On 9/9/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:

> On 06/09/13 17:45, Gabor Greif wrote:
>> On 9/5/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:
>>>
>>> I have been working on a new extension, OverloadedRecordFields, and it
>>> is now essentially feature-complete. Unfortunately, I doubt it will make
>>> it into 7.8, as the changes are quite extensive, but I hope to get it in
>>> HEAD soon thereafter.
>>
>> That would be great, it appears to be a great example of
>> -XConstraintKinds, too!
>
> It relies quite heavily on type-level strings (-XDataKinds), if that's
> what you mean?

No, I mean ConstraintKinds, I assume all the Has* constraints have
kind 'Constraint' ?
(I strongly assume so).

>
>
>>> I would really appreciate comments on the design [1], for which there is
>>
>> How would such a feature interact with
>> http://hackage.haskell.org/package/vinyl ?
>
> The short answer is that it shouldn't. Vinyl (which I wasn't aware of
> before now, thanks for the pointer!) basically replaces the Haskell
> records system wholesale, making records entirely separate from data
> declarations, and turning fields into first-class objects. This should
> peaceably coexist with -XOverloadedRecordFields but I don't see a way to
> integrate the two.

Okay. Thanks for the answers,

    Gabor


>
> Adam
>
>
>>     Gabor
>>
>>> a prototype implementation [2] that works in GHC 7.6.3. If you'd like to
>>> review the code, you can check out the overloaded-record-fields branch
>>> from the Github repositories [3, 4], and there are notes on the
>>> implementation on the wiki [5].
>>>
>>> Thanks!
>>>
>>> Adam
>>>
>>> [1]
>>> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Plan
>>> [2] https://github.com/adamgundry/records-prototype
>>> [3] https://github.com/adamgundry/ghc
>>> [4] https://github.com/adamgundry/packages-base
>>> [5]
>>> http://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields/Implementation
>
>



Reply | Threaded
Open this post in threaded view
|

OverloadedRecordFields status update

Adam Gundry
On 09/09/13 16:53, Gabor Greif wrote:

> On 9/9/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:
>> On 06/09/13 17:45, Gabor Greif wrote:
>>> On 9/5/13, Adam Gundry <adam.gundry at strath.ac.uk> wrote:
>>>>
>>>> I have been working on a new extension, OverloadedRecordFields, and it
>>>> is now essentially feature-complete. Unfortunately, I doubt it will make
>>>> it into 7.8, as the changes are quite extensive, but I hope to get it in
>>>> HEAD soon thereafter.
>>>
>>> That would be great, it appears to be a great example of
>>> -XConstraintKinds, too!
>>
>> It relies quite heavily on type-level strings (-XDataKinds), if that's
>> what you mean?
>
> No, I mean ConstraintKinds, I assume all the Has* constraints have
> kind 'Constraint' ?
> (I strongly assume so).

Ah, I see your point. Yes, the kind of `Has` is

    * -> Symbol -> * -> Constraint

although it is actually implemented as a typeclass in the base library,
so in this respect it's not particularly special. (Instances of the
typeclass are automatically generated and cannot be given in the normal
way, however.)

Cheers,

Adam

> ...