TcTyDecls

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

TcTyDecls

Contents

- Implicits
- Record selectors

Synopsis

- type RolesInfo = Name -> [Role]
- inferRoles :: HscSource -> RoleAnnotEnv -> [TyCon] -> Name -> [Role]
- checkSynCycles :: UnitId -> [TyCon] -> [LTyClDecl GhcRn] -> TcM ()
- checkClassCycles :: Class -> Maybe SDoc
- tcAddImplicits :: [TyCon] -> TcM TcGblEnv
- mkDefaultMethodType :: Class -> Id -> DefMethSpec Type -> Type
- mkRecSelBinds :: [TyCon] -> HsValBinds GhcRn
- mkOneRecordSelector :: [ConLike] -> RecSelParent -> FieldLabel -> (LSig GhcRn, (RecFlag, LHsBinds GhcRn))

# Documentation

type RolesInfo = Name -> [Role] #

inferRoles :: HscSource -> RoleAnnotEnv -> [TyCon] -> Name -> [Role] #

checkSynCycles :: UnitId -> [TyCon] -> [LTyClDecl GhcRn] -> TcM () #

Checks if any of the passed in `TyCon`s have cycles. Takes the `UnitId` of the home package (as we can avoid checking those TyCons: cycles never go through foreign packages) and the corresponding `LTyClDecl Name` for each `TyCon`, so we can give better error messages.

checkClassCycles :: Class -> Maybe SDoc #

# Implicits

tcAddImplicits :: [TyCon] -> TcM TcGblEnv #

mkDefaultMethodType :: Class -> Id -> DefMethSpec Type -> Type #

# Record selectors

mkRecSelBinds :: [TyCon] -> HsValBinds GhcRn #

mkOneRecordSelector :: [ConLike] -> RecSelParent -> FieldLabel -> (LSig GhcRn, (RecFlag, LHsBinds GhcRn)) #