GADT record syntax and contexts

Simon Peyton-Jones simonpj at microsoft.com
Tue Jun 16 05:20:39 EDT 2009


| PS. As a side-note. In section 7.4.5, the manual states that:
|
| "At the moment, record updates are not yet possible with GADT-style
| declarations, so support is limited to record construction, selection
| and pattern matching."
|
| However, if I add:
|
| update org@(B {}) x = org { arg = x }
|
| and evaluate "b $ update (B True) False" the response is "False" as one
| would expect. Is this line in the user guide outdated, or is support for
| updates unstable or partial?

Ah yes. The support is partial.  The update is supported if it "makes sense" from a type point of view. I should write down what "makes sense" means!

Simon


More information about the Glasgow-haskell-users mailing list