Note [Storing compatibility]
During axiom application, we need to be aware of which branches are compatible with which others. The full explanation is in Note [Compatibility] in GHc.Core.FamInstEnv. (The code is placed there to avoid a dependency from GHC.Core.Coercion.Axiom on the unification algorithm.) Although we could theoretically compute compatibility on the fly, this is silly, so we store it in a CoAxiom. Specifically, each branch refers to all other branches with which it is incompatible. This list might well be empty, and it will always be for the first branch of any axiom. CoAxBranches that do not (yet) belong to a CoAxiom should have a panic thunk stored in cab_incomps. The incompatibilities are properly a property of the axiom as a whole, and they are computed only when the final axiom is built. During serialization, the list is converted into a list of the indices of the branches.
References 1
- Compatibility GHC.Core.FamInstEnv
Referenced by 4
- GHC.Core.Coercion.Axiom call site
- GHC.Core.FamInstEnv call site
- GHC.Iface.Decl call site
- GHC.Iface.Syntax call site