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

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.DefaultEnv

Synopsis

- data ClassDefaults = ClassDefaults {
  - cd_class :: !TyCon
  - cd_types :: [Type]
  - cd_module :: Maybe Module
  - cd_warn :: Maybe (WarningTxt GhcRn)
  }
- type DefaultEnv = TyConEnv ClassDefaults
- emptyDefaultEnv :: DefaultEnv
- isEmptyDefaultEnv :: DefaultEnv -> Bool
- defaultEnv :: [ClassDefaults] -> DefaultEnv
- unitDefaultEnv :: ClassDefaults -> DefaultEnv
- lookupDefaultEnv :: DefaultEnv -> Name -> Maybe ClassDefaults
- filterDefaultEnv :: (ClassDefaults -> Bool) -> DefaultEnv -> DefaultEnv
- defaultList :: DefaultEnv -> [ClassDefaults]
- plusDefaultEnv :: DefaultEnv -> DefaultEnv -> DefaultEnv

# Documentation

data ClassDefaults Source #

Constructors

ClassDefaults |

Fields

- cd_class :: !TyCon

  always a class constructor

- cd_types :: [Type]
- cd_module :: Maybe Module

  `Nothing` for built-in, `Just` the current module or the module whence the default was imported see Note [Default exports] in GHC.Tc.Gen.Export

- cd_warn :: Maybe (WarningTxt GhcRn)

  Warning emitted when the default is used

#### Instances

Instances details

Data ClassDefaults Source # |

Instance details

Defined in GHC.Types.DefaultEnv

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ClassDefaults -> c ClassDefaults Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ClassDefaults Source #

toConstr :: ClassDefaults -> Constr Source #

dataTypeOf :: ClassDefaults -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ClassDefaults) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ClassDefaults) Source #

gmapT :: (forall b. Data b => b -> b) -> ClassDefaults -> ClassDefaults Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ClassDefaults -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ClassDefaults -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ClassDefaults -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ClassDefaults -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ClassDefaults -> m ClassDefaults Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassDefaults -> m ClassDefaults Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ClassDefaults -> m ClassDefaults Source #

Outputable ClassDefaults Source # |
Instance details Defined in GHC.Types.DefaultEnv Methods ppr :: ClassDefaults -> SDoc Source #

type DefaultEnv = TyConEnv ClassDefaults Source #

Default environment mapping class `TyCon`s to their default type lists

emptyDefaultEnv :: DefaultEnv Source #

isEmptyDefaultEnv :: DefaultEnv -> Bool Source #

defaultEnv :: [ClassDefaults] -> DefaultEnv Source #

unitDefaultEnv :: ClassDefaults -> DefaultEnv Source #

lookupDefaultEnv :: DefaultEnv -> Name -> Maybe ClassDefaults Source #

filterDefaultEnv :: (ClassDefaults -> Bool) -> DefaultEnv -> DefaultEnv Source #

defaultList :: DefaultEnv -> [ClassDefaults] Source #

plusDefaultEnv :: DefaultEnv -> DefaultEnv -> DefaultEnv Source #