Instances2NamedThing, Outputable
NamedThing FamInstDefined in ghc-9.10.3 · GHC.Core.FamInstEnvOutputable FamInstDefined in ghc-9.10.3 · GHC.Core.FamInstEnv
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Moduleghc-9.10.3GHC2021
NamedThing FamInstDefined in ghc-9.10.3 · GHC.Core.FamInstEnvOutputable FamInstDefined in ghc-9.10.3 · GHC.Core.FamInstEnvOutputable FamInstEnvDefined in ghc-9.10.3 · GHC.Core.FamInstEnvCreate a FamInstEnv from Name indices. INVARIANTS: * The fs_tvs are distinct in each FamInst of a range value of the map (so we can safely unify them)
Makes no particular effort to detect conflicts.
Outputable FamInstMatchDefined in ghc-9.10.3 · GHC.Core.FamInstEnvapartnessCheck :: [Type]flattened target arguments. Make sure they're flattened! See Note [Flattening type-family applications when matching instances] in GHC.Core.Unify.
-> CoAxBranchthe candidate equation we wish to use Precondition: this matches the target
-> BoolTrue = equation can fire
Do an apartness check, as described in the "Closed Type Families" paper (POPL '14). This should be used when determining if an equation (CoAxBranch) of a closed type family can be used to reduce a certain target type family application.
Result of testing two type family equations for injectiviy.
InjectivityAcceptedEither RHSs are distinct or unification of RHSs leads to unification of LHSs
InjectivityUnified CoAxBranch CoAxBranchRHSs unify but LHSs don't unify under that substitution. Relevant for closed type families where equation after unification might be overlapped (in which case it is OK if they don't unify). Constructor stores axioms after unification.
Check whether an open type family equation can be added to already existing instance environment without causing conflicts with supplied injectivity annotations. Returns list of conflicting axioms (type instance declarations).
Check whether two type family axioms don't violate injectivity annotation.
Get rid of *outermost* (or toplevel) * type function redex * data family redex * newtypes returning an appropriate Representational coercion. Specifically, if topNormaliseType_maybe env ty = Just (co, ty') then (a) co :: ty ~R ty' (b) ty' is not a newtype, and is not a type-family or data-family redex
However, ty' can be something like (Maybe (F ty)), where (F ty) is a redex.
Always operates homogeneously: the returned type has the same kind as the original type, and the returned coercion is always homogeneous.
Try to simplify a type-family application, by *one* step If topReduceTyFamApp_maybe env r F tys = Just (HetReduction (Reduction co rhs) res_co) then co :: F tys ~R# rhs res_co :: typeKind(F tys) ~ typeKind(rhs) Type families and data families; always Representational role