-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
triageRequires triageRequires triage
Description
#1247 changes the Instance type in the HsBindgen.Backend.SHs.AST module to include superclasses, and we add a TFree constructor to the SType datatype in the same module to represent free type variables. This allows us to write instances like:
instance ( ty ~ CFieldType MyInt "un_MyInt"
) => HasField "un_MyInt" (Ptr MyInt) (Ptr ty) whereThe downside of this approach is that ty is not really a free type variable. ty is bound implicitly in the class instance. For example, the following are equivalent:
instance S ty => C ty
instance forall ty. S ty => C tySo, using TFree is kind of cheating. If we wanted to represent instance types correctly, we should refactor Instance to use non-closed types with properly scoped type variables instead. And then we can probably remove TFree altogether.
Metadata
Metadata
Assignees
Labels
triageRequires triageRequires triage