willtim / row-polymorphism

Example row-polymorphism implementations
59 stars 6 forks source link

Qualified types #2

Open atennapel opened 7 years ago

atennapel commented 7 years ago

In the constrained rows implementation the lacks constraints are part of the type variables instead of being part of the type schemes like it is in the papers I read about row polymorphism, where qualified types are used. I was wondering if you knew an implementation of row polymorphism that uses qualified types? I am having trouble implementing it myself.

Specifically I'm talking about the paper: "A Polymorphic Type System for Extensible Records and Variants" by Benedict R. Gaster and Mark P. Jones.

willtim commented 7 years ago

Apologies for the late reply. You are absolutely correct that the implementation here does not use full qualified types. That is really part of the point of this code, to prove that it can be implemented as a very simple extension. If you did want to use qualified types, for example you also want type classes, then Mark Jones has a paper "Typing Haskell in Haskell" which shows how to add it. Good luck!

atennapel commented 7 years ago

Thanks for the reply! Yeah type classes is exactly the reason why I became interested in Qualified types, thanks for the paper suggestion!