ghc-7.6.3: The GHC API

Safe Haskell | None

FamInstEnv

Synopsis

- data FamInst = FamInst {
  - fi_axiom :: CoAxiom
  - fi_flavor :: FamFlavor
  - fi_fam :: Name
  - fi_tcs :: [Maybe Name]
  - fi_tvs :: TyVarSet
  - fi_fam_tc :: TyCon
  - fi_tys :: [Type]
  }
- data FamFlavor
  - = SynFamilyInst
  - | DataFamilyInst TyCon
- famInstAxiom :: FamInst -> CoAxiom
- famInstsRepTyCons :: [FamInst] -> [TyCon]
- famInstRepTyCon_maybe :: FamInst -> Maybe TyCon
- dataFamInstRepTyCon :: FamInst -> TyCon
- famInstLHS :: FamInst -> (TyCon, [Type])
- pprFamInst :: FamInst -> SDoc
- pprFamInstHdr :: FamInst -> SDoc
- pprFamInsts :: [FamInst] -> SDoc
- mkSynFamInst :: Name -> [TyVar] -> TyCon -> [Type] -> Type -> FamInst
- mkDataFamInst :: Name -> [TyVar] -> TyCon -> [Type] -> TyCon -> FamInst
- mkImportedFamInst :: Name -> [Maybe Name] -> CoAxiom -> FamInst
- type FamInstEnvs = (FamInstEnv, FamInstEnv)
- type FamInstEnv = UniqFM FamilyInstEnv
- emptyFamInstEnv :: FamInstEnv
- emptyFamInstEnvs :: (FamInstEnv, FamInstEnv)
- extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv
- deleteFromFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv
- extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv
- identicalFamInst :: FamInst -> FamInst -> Bool
- famInstEnvElts :: FamInstEnv -> [FamInst]
- familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst]
- lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch]
- lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [TyVar] -> [FamInstMatch]
- lookupFamInstEnvConflicts' :: FamInstEnv -> FamInst -> [TyVar] -> [FamInstMatch]
- topNormaliseType :: FamInstEnvs -> Type -> Maybe (Coercion, Type)
- normaliseType :: FamInstEnvs -> Type -> (Coercion, Type)
- normaliseTcApp :: FamInstEnvs -> TyCon -> [Type] -> (Coercion, Type)

# Documentation

data FamInst

Constructors

FamInst |
Fields fi_axiom :: CoAxiom fi_flavor :: FamFlavor fi_fam :: Name fi_tcs :: [Maybe Name] fi_tvs :: TyVarSet fi_fam_tc :: TyCon fi_tys :: [Type]

Instances

Outputable FamInst |
NamedThing FamInst |

data FamFlavor

Constructors

SynFamilyInst |
DataFamilyInst TyCon |

famInstAxiom :: FamInst -> CoAxiom

famInstsRepTyCons :: [FamInst] -> [TyCon]

famInstRepTyCon_maybe :: FamInst -> Maybe TyCon

dataFamInstRepTyCon :: FamInst -> TyCon

famInstLHS :: FamInst -> (TyCon, [Type])

pprFamInst :: FamInst -> SDoc

pprFamInstHdr :: FamInst -> SDoc

pprFamInsts :: [FamInst] -> SDoc

mkSynFamInst

Arguments

:: Name | Unique name for the coercion tycon
-> [TyVar] | Type parameters of the coercion (`tvs`)
-> TyCon | Family tycon (`F`)
-> [Type] | Type instance (`ts`)
-> Type | Representation tycon (`R`)
-> FamInst |

Create a coercion identifying a `type` family instance. It has the form `Co tvs :: F ts ~ R`, where `Co` is the coercion constructor built here, `F` the family tycon and `R` the right-hand side of the type family instance.

mkDataFamInst

Arguments

:: Name | Unique name for the coercion tycon
-> [TyVar] | Type parameters of the coercion (`tvs`)
-> TyCon | Family tycon (`F`)
-> [Type] | Type instance (`ts`)
-> TyCon | Representation tycon (`R`)
-> FamInst |

Create a coercion identifying a `data` or `newtype` representation type and its family instance. It has the form `Co tvs :: F ts ~ R tvs`, where `Co` is the coercion constructor built here, `F` the family tycon and `R` the (derived) representation tycon.

mkImportedFamInst :: Name -> [Maybe Name] -> CoAxiom -> FamInst

type FamInstEnvs = (FamInstEnv, FamInstEnv)

type FamInstEnv = UniqFM FamilyInstEnv

emptyFamInstEnv :: FamInstEnv

emptyFamInstEnvs :: (FamInstEnv, FamInstEnv)

extendFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv

deleteFromFamInstEnv :: FamInstEnv -> FamInst -> FamInstEnv

extendFamInstEnvList :: FamInstEnv -> [FamInst] -> FamInstEnv

identicalFamInst :: FamInst -> FamInst -> Bool

famInstEnvElts :: FamInstEnv -> [FamInst]

familyInstances :: (FamInstEnv, FamInstEnv) -> TyCon -> [FamInst]

lookupFamInstEnv :: FamInstEnvs -> TyCon -> [Type] -> [FamInstMatch]

lookupFamInstEnvConflicts :: FamInstEnvs -> FamInst -> [TyVar] -> [FamInstMatch]

lookupFamInstEnvConflicts' :: FamInstEnv -> FamInst -> [TyVar] -> [FamInstMatch]

topNormaliseType :: FamInstEnvs -> Type -> Maybe (Coercion, Type)

normaliseType :: FamInstEnvs -> Type -> (Coercion, Type)

normaliseTcApp :: FamInstEnvs -> TyCon -> [Type] -> (Coercion, Type)