Records in Haskell

Anthony Clayden anthony_clayden at clear.net.nz
Fri Feb 24 22:35:04 CET 2012


> Actually, I looked at the SORF page again:
>
http://hackage.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields
> There is now an 'Alternative Proposal' section that claims
> to solve polymorphic update.
> If anyone has comments on this please let us know!

Yes, Greg the quasifunctor stuff has been there for some
time.

You seem to be confused between polymorphic fields vs
type-changing update. Quasifunctor is talking about
type-changing update. (Look at the example given for `data R
a`: there's no polymorphic field.)

DORF already has a working approach to type-changing update.

I make reference to quasifunctor in the DORF proposal.
Essentially, if quasifunctor can be made to work for SORF,
it can also be made to work for DORF. (Because what
underlies both is to use a Has class with methods get/set.)

No, I don't think anybody has a satisfactory approach to
updating polymorphic/higher-ranked fields. (DORF mentions
one, but it's a ghastly hack.

In addition to higher-ranked types, SPJ is also concerned
about h-r's with constraints. I've added a very speculative
piece in DORF's comparison to SORF that considers using
Constraint Kinds. (It's probably piling ghastliness upon
ghastliness.)

> ... and not automatically
> abstract over fields. This leaves all of our future
> options open while satisfying the narrow issue at hand.
> 

What on earth do you mean by "not automatically abstract
over fields"?

AntC




More information about the Glasgow-haskell-users mailing list