Newcomer looking for help with changes to kind system

Shant Hairapetian shanth2600 at
Tue Apr 6 02:24:36 UTC 2021


I’m a master’s student working on implementing the changes outlined in
“Kinds are Calling Conventions“ ( I
have been working directly with Paul Downen but have hit some roadblocks.

To sum up the changes to the kind system, I am attempting to modify the
“TYPE” type constructor to accept, rather than just a RuntimeRep, a record
type (called RuntimeInfo) comprised of a RuntimeRep and a CallingConv
(calling convention). The calling convention has an “Eval” constructor
which accepts a levity (effectively moving the levity information from the
representation to the calling convention. LiftedRep and UnliftedRep would
also be collapsed into a single PtrRep constructor) and a “Call”
constructor (denoting the arity of primitive, extensional functions,
see: Making
a Faster Curry with Extensional Types
which accepts a list of RuntimeRep’s. I have created and wired-in the new
RuntimeInfo and CallingConv types in GHC.Builtin.Types, as well as the
corresponding primitive types in GHC.Builtin.Types.Prim and have modified
the “TYPE” constructor to accept a RuntimeInfo rather than a RuntimeRep.

My issue (well, one of my issues) is that, for unboxed tuples, though the
actual kind is being built up correctly, the expected type is still in the
old (or current) representation.

(expected) Couldn't match type: 'TupleRep ('[] @RuntimeRep)

(actual) with: 'RInfo ('TupleRep ('[] @RuntimeRep)) 'GHC.Types.ConvEval

I have not been able to locate where this expected kind is being
constructed. Any help this issue or general guidance would be greatly


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ghc-devs mailing list