Records in Haskell: Explicit Classy Records

Strake strake888 at gmail.com
Mon Apr 23 14:10:56 CEST 2012


On 22/04/2012, AntC <anthony_clayden at clear.net.nz> wrote:
> Matthew Farkas-Dyck <strake888 <at> gmail.com> writes:
>
>> I made another proposal for records in Haskell, meant to solve just
>> the namespace problem, and no more.
>> http://hackage.haskell.org/trac/ghc/wiki/Records/ExplicitClassyRecords
>>
>
> Thanks Matthew, I'm finding your wiki too sketchy to follow.
>
> What name(s) does your proposal generate? And what type(s) do they have?

Ahh, this is partly the beauty of it — it generates no names. All
names are user-declared. The system generates only instances.

> For record access, how does the compiler resolve to the right definition or
> instance from the context of use?

Just as it would any other. It's simply a type class.

> It seems you aren't making any proposal about record updating. So the acid
> test is how do you expect this to be treated:
>      e{ x = True }
> {* `e` is some arbitrary expression, possibly denoting a record type;
>    `x` one of those names for which you've solved the namespace problem
> *}

Ah, sorry; I added this to the wiki.

Cheers,
strake



More information about the Glasgow-haskell-users mailing list