TcFlatten

ghc-8.10.1: The GHC API

Safe Haskell | None
Language | Haskell2010

TcFlatten

Synopsis

- data FlattenMode
  - = FM_FlattenAll
  - | FM_SubstOnly
- flatten :: FlattenMode -> CtEvidence -> TcType -> TcS (Xi, TcCoercion)
- flattenKind :: CtLoc -> CtFlavour -> TcType -> TcS (Xi, TcCoercionN)
- flattenArgsNom :: CtEvidence -> TyCon -> [TcType] -> TcS ([Xi], [TcCoercion], TcCoercionN)
- rewriteTyVar :: TcTyVar -> TcS TcType
- unflattenWanteds :: Cts -> Cts -> TcS Cts

# Documentation

data FlattenMode Source #

Constructors

FM_FlattenAll |
FM_SubstOnly |

#### Instances

Instances details

Outputable FlattenMode # |
Instance details Defined in TcFlatten Methods ppr :: FlattenMode -> SDoc Source # pprPrec :: Rational -> FlattenMode -> SDoc Source #

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 TcRnTypes).

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

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

rewriteTyVar :: TcTyVar -> TcS TcType Source #

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