Note [Fixed RuntimeRep]
Definitions:
FRR.
The type `ty :: ki` has a /syntactically fixed RuntimeRep/
(we also say that `ty` is an `FRRType`)
<=>
the kind `ki` is concrete (in the sense of Note [Concrete types])
<=>
`typePrimRep ty` (= `kindPrimRep ki`) does not crash
(assuming that typechecking succeeded, so that all metavariables
in `ty` have been filled)
Fixed RuntimeRep.
The type `ty :: ki` has a /fixed RuntimeRep/
<=>
there exists an FRR type `ty'` with `ty ~# ty'`
<=>
there exists a concrete type `concrete_ki` such that
`ki ~ concrete_ki`
These definitions are crafted to be useful to satisfy the invariants of
Core; see Note [Representation polymorphism invariants] in GHC.Core.
Notice that "fixed RuntimeRep" means (for now anyway) that
* we know the runtime representation, and
* we know the levity.
For example (ty :: TYPE (BoxedRep l)), where `l` is a levity variable
is /not/ "fixed RuntimeRep", even though it is always represented by
a heap pointer, because we don't know the levity. In due course we
will want to make finer distinctions, as explained in the paper
Kinds are Calling Conventions [ICFP'20], but this suffices for now. References 2
- Representation polymorphism invariants GHC.Core
- Concrete types GHC.Tc.Utils.Concrete
Referenced by 23
- GHC.Tc.Utils.Unify call site ×4
- GHC.Tc.Utils.TcMType call site ×2
- GHC.Tc.Utils.TcType call site ×2
- Representation polymorphism invariants GHC.Core
- GHC.Core.Opt.Arity call site
- GHC.Core.TyCo.Rep call site
- GHC.Core.TyCon call site
- Representation-polymorphic TyCons GHC.Core.TyCon
- GHC.Core.Type call site
- GHC.Tc.TyCl.PatSyn call site
- GHC.Tc.Types.Evidence call site
- GHC.Tc.Types.Origin call site
- Concrete overview GHC.Tc.Utils.Concrete
- Representation polymorphism checking GHC.Tc.Utils.Concrete
- hasFixedRuntimeRep GHC.Tc.Utils.Concrete
- GHC.Tc.Utils.Concrete call site
- FixedRuntimeRep context in ExpType GHC.Tc.Utils.TcMType
- Return arguments with a fixed RuntimeRep GHC.Tc.Utils.Unify