ghc-lib-0.20201101: The GHC API, decoupled from GHC versions
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Solver.Flatten

Synopsis

Documentation

data FlattenMode Source #

Instances

Instances details
Outputable FlattenMode Source # 
Instance details

Defined in GHC.Tc.Solver.Flatten

Methods

ppr :: FlattenMode -> SDoc

flatten :: FlattenMode -> CtEvidence -> TcType -> TcS (Xi, TcCoercion) Source #

See Note [Flattening]. If (xi, co) <- flatten mode ev ty, then co :: xi ~r ty where r is the role in ev. If mode is FM_FlattenAll, then xi is almost function-free (Note [Almost function-free] in GHC.Tc.Types).

flattenKind :: CtLoc -> CtFlavour -> TcType -> TcS (Xi, TcCoercionN) Source #

flattenArgsNom :: CtEvidence -> TyCon -> [TcType] -> TcS ([Xi], [TcCoercion], TcCoercionN) Source #

flattenType :: CtLoc -> TcType -> TcS TcType Source #

Flatten a type w.r.t. nominal equality. This is useful to rewrite a type w.r.t. any givens. It does not do type-family reduction. This will never emit new constraints. Call this when the inert set contains only givens.

unflattenWanteds :: Cts -> Cts -> TcS Cts Source #