ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Core.Class

Synopsis

- data Class
- type ClassOpItem = (Id, DefMethInfo)
- data ClassATItem = ATI TyCon (Maybe (Type, TyFamEqnValidityInfo))
- data TyFamEqnValidityInfo
  - = NoVI
  - | VI {
    - vi_loc :: SrcSpan
    - vi_qtvs :: [TcTyVar]
    - vi_non_user_tvs :: TyVarSet
    - vi_pats :: [Type]
    - vi_rhs :: Type
    }
- type ClassMinimalDef = BooleanFormula GhcRn
- type DefMethInfo = Maybe (Name, DefMethSpec Type)
- pprDefMethInfo :: DefMethInfo -> SDoc
- type FunDep a = ([a], [a])
- pprFundeps :: Outputable a => [FunDep a] -> SDoc
- pprFunDep :: Outputable a => FunDep a -> SDoc
- mkClass :: Name -> [TyVar] -> [FunDep TyVar] -> [PredType] -> [Id] -> [ClassATItem] -> [ClassOpItem] -> ClassMinimalDef -> TyCon -> Class
- mkAbstractClass :: Name -> [TyVar] -> [FunDep TyVar] -> TyCon -> Class
- classTyVars :: Class -> [TyVar]
- classArity :: Class -> Arity
- classKey :: Class -> Unique
- className :: Class -> Name
- classATs :: Class -> [TyCon]
- classATItems :: Class -> [ClassATItem]
- classTyCon :: Class -> TyCon
- classMethods :: Class -> [Id]
- classOpItems :: Class -> [ClassOpItem]
- classBigSig :: Class -> ([TyVar], [PredType], [Id], [ClassOpItem])
- classExtraBigSig :: Class -> ([TyVar], [FunDep TyVar], [PredType], [Id], [ClassATItem], [ClassOpItem])
- classTvsFds :: Class -> ([TyVar], [FunDep TyVar])
- classSCTheta :: Class -> [PredType]
- classHasSCs :: Class -> Bool
- classAllSelIds :: Class -> [Id]
- classSCSelId :: Class -> Int -> Id
- classSCSelIds :: Class -> [Id]
- classMinimalDef :: Class -> ClassMinimalDef
- classHasFds :: Class -> Bool
- isAbstractClass :: Class -> Bool

# Documentation

data Class #

#### Instances

Instances details

Data Class # |
Instance details Defined in GHC.Core.Class Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Class -> c Class # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Class # toConstr :: Class -> Constr # dataTypeOf :: Class -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Class) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Class) # gmapT :: (forall b. Data b => b -> b) -> Class -> Class # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Class -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Class -> r # gmapQ :: (forall d. Data d => d -> u) -> Class -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Class -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Class -> m Class # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Class -> m Class # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Class -> m Class #
NamedThing Class # |
Instance details Defined in GHC.Core.Class Methods getOccName :: Class -> OccName # getName :: Class -> Name #
Uniquable Class # |
Instance details Defined in GHC.Core.Class Methods getUnique :: Class -> Unique #
Outputable Class # |
Instance details Defined in GHC.Core.Class Methods ppr :: Class -> SDoc #
Eq Class # |
Instance details Defined in GHC.Core.Class Methods (==) :: Class -> Class -> Bool # (/=) :: Class -> Class -> Bool #

type ClassOpItem = (Id, DefMethInfo) #

data ClassATItem #

Constructors

ATI TyCon (Maybe (Type, TyFamEqnValidityInfo)) | Default associated type (if any) from this template. As per Note [Associated type defaults], the Type has been renamed to use the class tyvars, while the `TyFamEqnValidityInfo` uses the original user-written type variables.

data TyFamEqnValidityInfo #

Information about a type family equation, used for validity checking of closed type family equations and associated type family default equations.

This type exists to delay validity-checking after typechecking type declaration groups, to avoid cyclic evaluation inside the typechecking knot.

See `Note [Type-checking default assoc decls]` in GHC.Tc.TyCl.

Constructors

NoVI | Used for equations which don't need any validity checking, for example equations imported from another module.
VI | Information necessary for validity checking of a type family equation.
Fields vi_loc :: SrcSpan vi_qtvs :: [TcTyVar] LHS quantified type variables vi_non_user_tvs :: TyVarSet non-user-written type variables (for error message reporting) Example: with -XPolyKinds, typechecking `type instance forall a. F = ()` introduces the kind variable `k` for the kind of `a`. See #23734. vi_pats :: [Type] LHS patterns vi_rhs :: Type RHS of the equation NB: for associated type family default declarations, this is the RHS *before* applying the substitution from Note [Type-checking default assoc decls] in GHC.Tc.TyCl.

type ClassMinimalDef = BooleanFormula GhcRn #

type DefMethInfo = Maybe (Name, DefMethSpec Type) #

pprDefMethInfo :: DefMethInfo -> SDoc #

type FunDep a = ([a], [a]) #

pprFundeps :: Outputable a => [FunDep a] -> SDoc #

pprFunDep :: Outputable a => FunDep a -> SDoc #

mkClass :: Name -> [TyVar] -> [FunDep TyVar] -> [PredType] -> [Id] -> [ClassATItem] -> [ClassOpItem] -> ClassMinimalDef -> TyCon -> Class #

mkAbstractClass :: Name -> [TyVar] -> [FunDep TyVar] -> TyCon -> Class #

classTyVars :: Class -> [TyVar] #

classArity :: Class -> Arity #

classKey :: Class -> Unique #

className :: Class -> Name #

classATs :: Class -> [TyCon] #

classATItems :: Class -> [ClassATItem] #

classTyCon :: Class -> TyCon #

classMethods :: Class -> [Id] #

classOpItems :: Class -> [ClassOpItem] #

classBigSig :: Class -> ([TyVar], [PredType], [Id], [ClassOpItem]) #

classExtraBigSig :: Class -> ([TyVar], [FunDep TyVar], [PredType], [Id], [ClassATItem], [ClassOpItem]) #

classTvsFds :: Class -> ([TyVar], [FunDep TyVar]) #

classSCTheta :: Class -> [PredType] #

classHasSCs :: Class -> Bool #

classAllSelIds :: Class -> [Id] #

classSCSelId :: Class -> Int -> Id #

classSCSelIds :: Class -> [Id] #

classMinimalDef :: Class -> ClassMinimalDef #

classHasFds :: Class -> Bool #

isAbstractClass :: Class -> Bool #