Note [The Unsatisfiable representation-polymorphism trick]
The class method `unsatisfiableLifted :: forall (a::Type). Unsatisfiable msg => a`
works only for lifted types `a`. What if we want an unsatisfiable value of type
`Int#`, say? The function `unsatisfiable` has a representation-polymorphic type
unsatisfiable :: forall {rep} (msg :: ErrorMessage) (b :: TYPE rep).
Unsatisfiable msg => b
and yet is defined in terms of `unsatisfiableLifted`. How? By instantiating
`unsatisfiableLifted` at type `(##) -> b`, and applying the result to `(##)`.
Very cunning! References 0
This Note does not link to any other.
Referenced by 1
- Evidence terms from Unsatisfiable Givens GHC.Tc.Solver.Default