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

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.GREInfo

Contents

- * * GREInfo * * ************************************************************************ Note [GREInfo] ~~~~~~~~~~~~~~ In the renamer, we sometimes need a bit more information about a `Name`, e.g. whether it is a type constructor, class, data constructor, record field, etc. For example, when typechecking record construction, the renamer needs to look up the fields of the data constructor being used (see e.g. GHC.Rename.Pat.rnHsRecFields). Extra information also allows us to provide better error messages when a fatal error occurs in the renamer, as it allows us to distinguish classes, type families, type synonyms, etc. For imported Names, we have access to the full type information in the form of a TyThing (although see Note [Retrieving the GREInfo from interfaces]). However, for Names in the module currently being renamed, we don't yet have full information. Instead of using TyThing, we use the GREInfo type, and this information gets affixed to each element in the GlobalRdrEnv. This allows us to treat imported and local Names in a consistent manner: always look at the GREInfo. Note [Retrieving the GREInfo from interfaces] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have a TyThing, we can easily compute the corresponding GREInfo: this is done in GHC.Types.TyThing.tyThingGREInfo. However, one often needs to produce GlobalRdrElts (and thus their GREInfos) directly after loading interface files, before they are typechecked. For example: - GHC.Tc.Module.tcRnModuleTcRnM first calls tcRnImports, which starts off calling rnImports which transitively calls filterImports. That function is responsible for coughing up GlobalRdrElts (and their GREInfos) obtained from interfaces, but we will only typecheck the interfaces after we have finished processing the imports (see e.g. the logic at the start of tcRnImports which sets eps_is_boot, which decides whether we should look in the boot or non-boot interface for any particular module). - GHC.Tc.Utils.Backpack.mergeSignatures first loads the relevant signature interfaces to merge them, but only later on does it typecheck them. In both of these examples, what's important is that we **lazily** produce the GREInfo: it should only be consulted once the interfaces have been typechecked, which will add the necessary information to the type-level environment. In particular, the respective functions `filterImports` and `mergeSignatures` should NOT force the gre_info field. We delay the loading of interfaces by making the gre_info field of `GlobalRdrElt` a thunk which, when forced, loads the interface, looks up the `Name` in the type environment to get its associated TyThing, and computes the GREInfo from that. See `lookupGREInfo`. A possible alternative design would be to change the AvailInfo datatype to also store GREInfo. We currently don't do that, as this would mean that every time an interface re-exports something it has to also provide its GREInfo, which could lead to bloat. Note [Forcing GREInfo] ~~~~~~~~~~~~~~~~~~~~~~ The GREInfo field of a GlobalRdrElt needs to be lazy, as explained in Note [Retrieving the GREInfo from interfaces]. For imported things, this field is usually a thunk which looks up the GREInfo in a type environment (see GHC.Rename.Env.lookupGREInfo). We thus need to be careful not to introduce space leaks: such thunks could end up retaining old type environments, which would violate invariant (5) of Note [GHC Heap Invariants] in GHC.Driver.Make. This can happen, for example, when reloading in GHCi (see e.g. test T15369, which can trigger the ghci leak check if we're not careful). A naive approach is to simply deeply force the whole GlobalRdrEnv. However, forcing the GREInfo thunks can force the loading of interface files which we otherwise might not need to load, so it leads to wasted work. Instead, whenever we are about to store the GlobalRdrEnv somewhere (such as in ModDetails), we dehydrate it by stripping away the GREInfo field, turning it into (). See `forceGlobalRdrEnv` and its cousin `hydrateGlobalRdrEnv`, as well as Note [IfGlobalRdrEnv] in GHC.Types.Name.Reader. Search for references to this note in the code for illustration.
- * * Constructor info * * ************************************************************************ Note [Local constructor info in the renamer] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As explained in Note [GREInfo], information pertinent to the renamer is stored using the GREInfo datatype. What information do we need about constructors? Consider the following example: data T = T1 { x, y :: Int } | T2 { x :: Int } | T3 | T4 Int Bool We need to know: * The fields of the data constructor, so that - We can complain if you say `T1 { v = 3 }`, where `v` is not a field of `T1` See the following call stack * GHC.Rename.Expr.rnExpr (RecordCon case) * GHC.Rename.Pat.rnHsRecFields * GHC.Rename.Env.lookupRecFieldOcc - Ditto if you pattern match on `T1 { v = x }`. See the following call stack * GHC.Rename.Pat.rnHsRecPatsAndThen * GHC.Rename.Pat.rnHsRecFields * GHC.Rename.Env.lookupRecFieldOcc - We can fill in the dots if you say `T1 {..}` in construction or pattern matching See GHC.Rename.Pat.rnHsRecFields.rn_dotdot This information is stored in ConFieldInfo. * Whether the constructor is nullary. We need to know this to accept `T2 {..}`, and `T3 {..}`, but reject `T4 {..}`, in both construction and pattern matching. See GHC.Rename.Pat.rnHsRecFields.rn_dotdot and Note [Nullary constructors and empty record wildcards] This information is stored in ConFieldInfo. * Whether the constructor is a data constructor or a pattern synonym, and, if it is a data constructor, what are the other data constructors of the parent type. This is used for computing irrefutability of pattern matches when deciding how to desugar do blocks (whether to use a fail operation). See GHC.Hs.Pat.isIrrefutableHsPat. This information is stored in ConLikeInfo. Note [Nullary constructors and empty record wildcards] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A nullary constructor is one with no arguments. For example, both `data T = MkT` and `data T = MkT {}` are nullary. For consistency and TH convenience, it was agreed that a `{..}` match or usage on nullary constructors would be accepted. This is done as as per https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0496-empty-record-wildcards.rst
- * * Record field info * * **********************************************************************

Description

Renamer-level information about `Name`s.

Renamer equivalent of `TyThing`.

Synopsis

- data GREInfo
  - = Vanilla
  - | UnboundGRE
  - | IAmTyCon !(TyConFlavour Name)
  - | IAmConLike !ConInfo
  - | IAmRecField !RecFieldInfo
- plusGREInfo :: GREInfo -> GREInfo -> GREInfo
- data ConInfo = ConInfo {
  - conLikeInfo :: !ConLikeInfo
  - conFieldInfo :: !ConFieldInfo
  }
- data ConLikeInfo
  - = ConIsData {
    - conLikeDataCons :: [Name]
    }
  - | ConIsPatSyn
- data ConFieldInfo
  - = ConHasRecordFields (NonEmpty FieldLabel)
  - | ConHasPositionalArgs
  - | ConIsNullary
- mkConInfo :: ConLikeInfo -> Arity -> [FieldLabel] -> ConInfo
- mkConFieldInfo :: Arity -> [FieldLabel] -> ConFieldInfo
- conInfoFields :: ConInfo -> [FieldLabel]
- conFieldInfoFields :: ConFieldInfo -> [FieldLabel]
- data ConLikeName
  - = DataConName {
    - conLikeName_Name :: !Name
    }
  - | PatSynName {
    - conLikeName_Name :: !Name
    }
- data RecFieldInfo = RecFieldInfo {
  - recFieldLabel :: !FieldLabel
  - recFieldCons :: !(UniqSet ConLikeName)
  }

#### * * GREInfo * * ************************************************************************ Note [GREInfo] ~~~~~~~~~~~~~~ In the renamer, we sometimes need a bit more information about a `Name`, e.g. whether it is a type constructor, class, data constructor, record field, etc. For example, when typechecking record construction, the renamer needs to look up the fields of the data constructor being used (see e.g. GHC.Rename.Pat.rnHsRecFields). Extra information also allows us to provide better error messages when a fatal error occurs in the renamer, as it allows us to distinguish classes, type families, type synonyms, etc. For imported Names, we have access to the full type information in the form of a TyThing (although see Note [Retrieving the GREInfo from interfaces]). However, for Names in the module currently being renamed, we don't yet have full information. Instead of using TyThing, we use the GREInfo type, and this information gets affixed to each element in the GlobalRdrEnv. This allows us to treat imported and local Names in a consistent manner: always look at the GREInfo. Note [Retrieving the GREInfo from interfaces] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If we have a TyThing, we can easily compute the corresponding GREInfo: this is done in GHC.Types.TyThing.tyThingGREInfo. However, one often needs to produce GlobalRdrElts (and thus their GREInfos) directly after loading interface files, before they are typechecked. For example: - GHC.Tc.Module.tcRnModuleTcRnM first calls tcRnImports, which starts off calling rnImports which transitively calls filterImports. That function is responsible for coughing up GlobalRdrElts (and their GREInfos) obtained from interfaces, but we will only typecheck the interfaces after we have finished processing the imports (see e.g. the logic at the start of tcRnImports which sets eps_is_boot, which decides whether we should look in the boot or non-boot interface for any particular module). - GHC.Tc.Utils.Backpack.mergeSignatures first loads the relevant signature interfaces to merge them, but only later on does it typecheck them. In both of these examples, what's important is that we **lazily** produce the GREInfo: it should only be consulted once the interfaces have been typechecked, which will add the necessary information to the type-level environment. In particular, the respective functions `filterImports` and `mergeSignatures` should NOT force the gre_info field. We delay the loading of interfaces by making the gre_info field of `GlobalRdrElt` a thunk which, when forced, loads the interface, looks up the `Name` in the type environment to get its associated TyThing, and computes the GREInfo from that. See `lookupGREInfo`. A possible alternative design would be to change the AvailInfo datatype to also store GREInfo. We currently don't do that, as this would mean that every time an interface re-exports something it has to also provide its GREInfo, which could lead to bloat. Note [Forcing GREInfo] ~~~~~~~~~~~~~~~~~~~~~~ The GREInfo field of a GlobalRdrElt needs to be lazy, as explained in Note [Retrieving the GREInfo from interfaces]. For imported things, this field is usually a thunk which looks up the GREInfo in a type environment (see GHC.Rename.Env.lookupGREInfo). We thus need to be careful not to introduce space leaks: such thunks could end up retaining old type environments, which would violate invariant (5) of Note [GHC Heap Invariants] in GHC.Driver.Make. This can happen, for example, when reloading in GHCi (see e.g. test T15369, which can trigger the ghci leak check if we're not careful). A naive approach is to simply deeply force the whole GlobalRdrEnv. However, forcing the GREInfo thunks can force the loading of interface files which we otherwise might not need to load, so it leads to wasted work. Instead, whenever we are about to store the GlobalRdrEnv somewhere (such as in ModDetails), we dehydrate it by stripping away the GREInfo field, turning it into (). See `forceGlobalRdrEnv` and its cousin `hydrateGlobalRdrEnv`, as well as Note [IfGlobalRdrEnv] in GHC.Types.Name.Reader. Search for references to this note in the code for illustration.

data GREInfo Source #

Information about a `Name` that is pertinent to the renamer.

See Note [GREInfo]

Constructors

Vanilla | No particular information... e.g. a function
UnboundGRE | An unbound GRE... could be anything
IAmTyCon !(TyConFlavour Name) | `TyCon`
IAmConLike | `ConLike`

Fields

- !ConInfo

  The constructor fields. See Note [Local constructor info in the renamer]. | Record field

IAmRecField !RecFieldInfo |

#### Instances

Instances details

NFData GREInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: GREInfo -> () Source #
Data GREInfo Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: GREInfo -> Constr Source #

dataTypeOf :: GREInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

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

plusGREInfo :: GREInfo -> GREInfo -> GREInfo Source #

#### * * Constructor info * * ************************************************************************ Note [Local constructor info in the renamer] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ As explained in Note [GREInfo], information pertinent to the renamer is stored using the GREInfo datatype. What information do we need about constructors? Consider the following example: data T = T1 { x, y :: Int } | T2 { x :: Int } | T3 | T4 Int Bool We need to know: * The fields of the data constructor, so that - We can complain if you say `T1 { v = 3 }`, where `v` is not a field of `T1` See the following call stack * GHC.Rename.Expr.rnExpr (RecordCon case) * GHC.Rename.Pat.rnHsRecFields * GHC.Rename.Env.lookupRecFieldOcc - Ditto if you pattern match on `T1 { v = x }`. See the following call stack * GHC.Rename.Pat.rnHsRecPatsAndThen * GHC.Rename.Pat.rnHsRecFields * GHC.Rename.Env.lookupRecFieldOcc - We can fill in the dots if you say `T1 {..}` in construction or pattern matching See GHC.Rename.Pat.rnHsRecFields.rn_dotdot This information is stored in ConFieldInfo. * Whether the constructor is nullary. We need to know this to accept `T2 {..}`, and `T3 {..}`, but reject `T4 {..}`, in both construction and pattern matching. See GHC.Rename.Pat.rnHsRecFields.rn_dotdot and Note [Nullary constructors and empty record wildcards] This information is stored in ConFieldInfo. * Whether the constructor is a data constructor or a pattern synonym, and, if it is a data constructor, what are the other data constructors of the parent type. This is used for computing irrefutability of pattern matches when deciding how to desugar do blocks (whether to use a fail operation). See GHC.Hs.Pat.isIrrefutableHsPat. This information is stored in ConLikeInfo. Note [Nullary constructors and empty record wildcards] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A nullary constructor is one with no arguments. For example, both `data T = MkT` and `data T = MkT {}` are nullary. For consistency and TH convenience, it was agreed that a `{..}` match or usage on nullary constructors would be accepted. This is done as as per https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0496-empty-record-wildcards.rst

data ConInfo Source #

Information known to the renamer about a data constructor or pattern synonym.

See Note [Local constructor info in the renamer].

Constructors

ConInfo |

Fields

- conLikeInfo :: !ConLikeInfo
- conFieldInfo :: !ConFieldInfo

#### Instances

Instances details

NFData ConInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: ConInfo -> () Source #
Data ConInfo Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: ConInfo -> Constr Source #

dataTypeOf :: ConInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable ConInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods ppr :: ConInfo -> SDoc Source #
Eq ConInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods (==) :: ConInfo -> ConInfo -> Bool Source # (/=) :: ConInfo -> ConInfo -> Bool Source #

data ConLikeInfo Source #

Whether a constructor is a data constructor or a pattern synonym.

See Note [Local constructor info in the renamer].

Constructors

ConIsData |

Fields

- conLikeDataCons :: [Name]

  All the `DataCon`s of the parent `TyCon`, including the `ConLike` itself.

  Used in `isIrrefutableHsPat`.

ConIsPatSyn |

#### Instances

Instances details

NFData ConLikeInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: ConLikeInfo -> () Source #
Data ConLikeInfo Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: ConLikeInfo -> Constr Source #

dataTypeOf :: ConLikeInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable ConLikeInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods ppr :: ConLikeInfo -> SDoc Source #
Eq ConLikeInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods (==) :: ConLikeInfo -> ConLikeInfo -> Bool Source # (/=) :: ConLikeInfo -> ConLikeInfo -> Bool Source #

data ConFieldInfo Source #

Information about the record fields of a constructor.

See Note [Local constructor info in the renamer]

Constructors

ConHasRecordFields (NonEmpty FieldLabel) |
ConHasPositionalArgs |
ConIsNullary |

#### Instances

Instances details

NFData ConFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: ConFieldInfo -> () Source #
Data ConFieldInfo Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: ConFieldInfo -> Constr Source #

dataTypeOf :: ConFieldInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable ConFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods ppr :: ConFieldInfo -> SDoc Source #
Eq ConFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods (==) :: ConFieldInfo -> ConFieldInfo -> Bool Source # (/=) :: ConFieldInfo -> ConFieldInfo -> Bool Source #

mkConInfo :: ConLikeInfo -> Arity -> [FieldLabel] -> ConInfo Source #

mkConFieldInfo :: Arity -> [FieldLabel] -> ConFieldInfo Source #

conInfoFields :: ConInfo -> [FieldLabel] Source #

conFieldInfoFields :: ConFieldInfo -> [FieldLabel] Source #

data ConLikeName Source #

The `Name` of a `ConLike`.

Useful when we are in the renamer and don't yet have a full `DataCon` or `PatSyn` to hand.

Constructors

DataConName |

Fields

- conLikeName_Name :: !Name

PatSynName |

Fields

- conLikeName_Name :: !Name

#### Instances

Instances details

NFData ConLikeName Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: ConLikeName -> () Source #
Data ConLikeName Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: ConLikeName -> Constr Source #

dataTypeOf :: ConLikeName -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Uniquable ConLikeName Source # |
Instance details Defined in GHC.Types.GREInfo Methods getUnique :: ConLikeName -> Unique Source #
Outputable ConLikeName Source # |
Instance details Defined in GHC.Types.GREInfo Methods ppr :: ConLikeName -> SDoc Source #
OutputableBndr ConLikeName Source # |
Instance details Defined in GHC.Types.GREInfo Methods pprBndr :: BindingSite -> ConLikeName -> SDoc Source # pprPrefixOcc :: ConLikeName -> SDoc Source # pprInfixOcc :: ConLikeName -> SDoc Source # bndrIsJoin_maybe :: ConLikeName -> JoinPointHood Source #
Eq ConLikeName Source # |
Instance details Defined in GHC.Types.GREInfo Methods (==) :: ConLikeName -> ConLikeName -> Bool Source # (/=) :: ConLikeName -> ConLikeName -> Bool Source #

#### * * Record field info * * **********************************************************************

data RecFieldInfo Source #

Constructors

RecFieldInfo |

Fields

- recFieldLabel :: !FieldLabel
- recFieldCons :: !(UniqSet ConLikeName)

  The constructors which have this field label. Always non-empty.

  NB: these constructors will always share a single parent, as the field label disambiguates between parents in the presence of duplicate record fields.

#### Instances

Instances details

NFData RecFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods rnf :: RecFieldInfo -> () Source #
Data RecFieldInfo Source # |

Instance details

Defined in GHC.Types.GREInfo

Methods

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

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

toConstr :: RecFieldInfo -> Constr Source #

dataTypeOf :: RecFieldInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable RecFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods ppr :: RecFieldInfo -> SDoc Source #
Eq RecFieldInfo Source # |
Instance details Defined in GHC.Types.GREInfo Methods (==) :: RecFieldInfo -> RecFieldInfo -> Bool Source # (/=) :: RecFieldInfo -> RecFieldInfo -> Bool Source #