Note [Apartness]
In dealing with closed type families, we must be able to check that one type will never reduce to another. This check is called /apartness/. The check is always between a target (which may be an arbitrary type) and a pattern. Here is how we do it: apart(target, pattern) = not (unify(flatten(target), pattern)) where flatten (implemented in flattenTys, below) converts all type-family applications into fresh variables. (See Note [Apartness and type families] in GHC.Core.Unify.)
References 1
- Apartness and type families GHC.Core.Unify
Referenced by 2
- Conflict checking for axiom applications GHC.Core.Lint
- GHC.Core.Lint call site