Skip to content

Make PrimTyConI contain a type

When using Template Haskell to reify a primitive TyCon, GHC returns a structure containing the number of arguments and whether the saturated TyCon is unlifted.

data Info =
   ...
  -- | A \"primitive\" type constructor, which can't be expressed with a 'Dec'.
  -- Examples: @(->)@, @Int#@.
  | PrimTyConI
       Name
       Arity
       Unlifted
  | ...

I propose to change this to PrimTyConI Name Type.

This interface was written before levity and representation were on a solid ground. It does not say what is the representation of arguments (e.g. FUN is special, !7299 (closed) adds levity-polymorphic arrays), what is the representation of the result (e.g. Int8# and Int64# are both unlifted but represented differently); the boolean cannot represent a levity-polymorphic result, if we ever have it.

This will be consistent with other constructors of Info: ClassOpI and DataConI contains a Type, PatSynI contains a PatSynType.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information