Note [Apartness]

GHC/Core/FamInstEnv.hs:481 compiler

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

Referenced by 2