ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

TcFlatten

Synopsis

- data FlattenEnv = FE {
  - fe_mode :: FlattenMode
  - fe_loc :: CtLoc
  - fe_flavour :: CtFlavour
  - fe_eq_rel :: EqRel
  }
- data FlattenMode
  - = FM_FlattenAll
  - | FM_Avoid TcTyVar Bool
  - | FM_SubstOnly
- mkFlattenEnv :: FlattenMode -> CtEvidence -> FlattenEnv
- flatten :: FlattenMode -> CtEvidence -> TcType -> TcS (Xi, TcCoercion)
- flattenMany :: FlattenMode -> CtEvidence -> [Role] -> [TcType] -> TcS ([Xi], [TcCoercion])
- flatten_many :: FlattenEnv -> [Role] -> [Type] -> TcS ([Xi], [TcCoercion])
- flattenFamApp :: FlattenMode -> CtEvidence -> TyCon -> [TcType] -> TcS (Xi, TcCoercion)
- flattenTyVarOuter :: FlattenEnv -> TcTyVar -> TcS (Either TyVar (TcType, TcCoercion))
- unflatten :: Cts -> Cts -> TcS Cts
- eqCanRewrite :: CtEvidence -> CtEvidence -> Bool
- eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool
- canRewriteOrSame :: CtEvidence -> CtEvidence -> Bool
- type CtFlavourRole = (CtFlavour, EqRel)
- ctEvFlavourRole :: CtEvidence -> CtFlavourRole
- ctFlavourRole :: Ct -> CtFlavourRole

# Documentation

data FlattenEnv

Constructors

FE |

Fields

fe_mode :: FlattenMode
fe_loc :: CtLoc
fe_flavour :: CtFlavour
fe_eq_rel :: EqRel

data FlattenMode

Constructors

FM_FlattenAll |
FM_Avoid TcTyVar Bool |
FM_SubstOnly |

mkFlattenEnv :: FlattenMode -> CtEvidence -> FlattenEnv

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

flattenMany :: FlattenMode -> CtEvidence -> [Role] -> [TcType] -> TcS ([Xi], [TcCoercion])

flatten_many :: FlattenEnv -> [Role] -> [Type] -> TcS ([Xi], [TcCoercion])

flattenFamApp :: FlattenMode -> CtEvidence -> TyCon -> [TcType] -> TcS (Xi, TcCoercion)

flattenTyVarOuter :: FlattenEnv -> TcTyVar -> TcS (Either TyVar (TcType, TcCoercion))

unflatten :: Cts -> Cts -> TcS Cts

eqCanRewrite :: CtEvidence -> CtEvidence -> Bool

eqCanRewriteFR :: CtFlavourRole -> CtFlavourRole -> Bool

canRewriteOrSame :: CtEvidence -> CtEvidence -> Bool

type CtFlavourRole = (CtFlavour, EqRel)

Whether or not one `Ct` can rewrite another is determined by its flavour and its equality relation

ctEvFlavourRole :: CtEvidence -> CtFlavourRole

Extract the flavour and role from a `CtEvidence`

ctFlavourRole :: Ct -> CtFlavourRole

Extract the flavour and role from a `Ct`