GHC.Tc.Solver.Rewrite

ghc-9.2.8: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Tc.Solver.Rewrite

Synopsis

- rewrite :: CtEvidence -> TcType -> TcS (Xi, TcCoercion)
- rewriteKind :: CtLoc -> CtFlavour -> TcType -> TcS (Xi, TcCoercionN)
- rewriteArgsNom :: CtEvidence -> TyCon -> [TcType] -> TcS ([Xi], [TcCoercion])
- rewriteType :: CtLoc -> TcType -> TcS TcType

# Documentation

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

See Note [Rewriting]. If (xi, co) <- rewrite mode ev ty, then co :: xi ~r ty where r is the role in `ev`.

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

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

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

Rewrite 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.