Moduleghc-9.10.3GHC2021
GHC.Tc.Utils.Unify
Type subsumption and unification
- 8 types
- 45 values
- Packageghc-9.10.3
- Exports53
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceUnify.hs
The wrapper has type: spec_ty ~> expected_ty See Note [Skolemisation] for the differences between tcSkolemiseCompleteSig and tcTopSkolemise
unifyType :: Maybe TypedThingIf present, the thing that has type ty1
-> TcTauType-> TcTauType-> TcM TcCoercionN
Infer a type using a fresh ExpType See also Note [ExpType] in GHC.Tc.Utils.TcMType
Use tcInferFRR if you require the type to have a fixed runtime representation.
Use this function to split off arguments types when you have an "expected" type.
This function skolemises at each polytype.
Invariant: this function only applies the provided function to a list of argument types which all have a syntactically fixed RuntimeRep in the sense of Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete. See Note [Return arguments with a fixed RuntimeRep].
matchExpectedFunKind :: TypedThingtype, only for errors
-> Arityn: number of desired arrows
-> TcKindfun_kind
-> TcM Coercionco :: fun_kind ~ (arg1 -> ... -> argn -> res)
Breaks apart a function kind into its pieces.
matchActualFunTy :: ExpectedFunTyOriginSee Note [Herald for matchExpectedFunTys]
-> Maybe TypedThingThe thing with type TcSigmaType
-> (Arity, TcType)Total number of value args in the call, and the original function type (Both are used only for error messages)
-> TcRhoTypeType to analyse: a TcRhoType
-> TcM (HsWrapper, Scaled TcSigmaTypeFRR, TcSigmaType)
matchActualFunTy looks for just one function arrow, returning an uninstantiated sigma-type.
Invariant: the returned argument type has a syntactically fixed RuntimeRep in the sense of Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete.
See Note [Return arguments with a fixed RuntimeRep].
matchActualFunTys :: ExpectedFunTyOriginSee Note [Herald for matchExpectedFunTys]
-> CtOrigin-> Arity-> TcSigmaType-> TcM (HsWrapper, [Scaled TcSigmaTypeFRR], TcRhoType)
Like matchExpectedFunTys, but used when you have an "actual" type, for example in function application.
INVARIANT: the returned argument types all have a syntactically fixed RuntimeRep in the sense of Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete. See Note [Return arguments with a fixed RuntimeRep].
Constructors
PuFail CheckTyEqResultPuOK (Bag a) b
Instances3Functor, Applicative, Outputable
Functor (PuResult a)Defined in ghc-9.10.3 · GHC.Tc.Utils.UnifyApplicative (PuResult a)Defined in ghc-9.10.3 · GHC.Tc.Utils.Unify(Outputable a, Outputable b) => Outputable (PuResult a b)Defined in ghc-9.10.3 · GHC.Tc.Utils.Unify
Options describing how to deal with a type equality in the pure unifier. See checkTyEqRhs
Constructors
Instances1Outputable
Outputable (TyEqFlags a)Defined in ghc-9.10.3 · GHC.Tc.Utils.Unify
What to do when encountering a type-family application while processing a type equality in the pure unifier.
See Note [Family applications in canonical constraints]
Constructors
Instances1Outputable
Outputable (TyEqFamApp a)Defined in ghc-9.10.3 · GHC.Tc.Utils.Unify
Constructors
Instances1Outputable
Outputable AreUnifyingDefined in ghc-9.10.3 · GHC.Tc.Utils.Unify
Instances1Outputable
Outputable LevelCheckDefined in ghc-9.10.3 · GHC.Tc.Utils.Unify