Note [Un-unified unification variables]
What should we do if we find a Flexi unification variable?
There are three possibilities:
* DefaultFlexi: this is the common case, in situations like
length @alpha ([] @alpha)
It really doesn't matter what type we choose for alpha. But
we must choose a type! We can't leave mutable unification
variables floating around: after typecheck is complete, every
type variable occurrence must have a binding site.
So we default it to 'Any' of the right kind.
All this works for both type and kind variables (indeed
the two are the same thing).
* SkolemiseFlexi: is a special case for the LHS of RULES.
See Note [Zonking the LHS of a RULE]
* RuntimeUnkFlexi: is a special case for the GHCi debugger.
It's a way to have a variable that is not a mutable
unification variable, but doesn't have a binding site
either.
* NoFlexi: See Note [Error on unconstrained meta-variables]
in GHC.Tc.Utils.TcMType. This mode will panic on unfilled
meta-variables. References 2
- Error on unconstrained meta-variables GHC.Tc.Utils.TcMType
- Zonking the LHS of a RULE GHC.Tc.Zonk.Type
Referenced by 3
- GHC.Tc.Zonk.Env call site
- The ZonkEnv GHC.Tc.Zonk.Env
- Module structure for zonking GHC.Tc.Zonk.Type