GHC.Types.FieldLabel

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

Safe Haskell | Ignore
Language | GHC2021

GHC.Types.FieldLabel

Contents

- Orphan instances

Synopsis

- type FieldLabelEnv = DFastStringEnv FieldLabel
- data FieldLabel = FieldLabel {
  - flHasDuplicateRecordFields :: DuplicateRecordFields
  - flHasFieldSelector :: FieldSelectors
  - flSelector :: Name
  }
- flLabel :: FieldLabel -> FieldLabelString
- data DuplicateRecordFields
  - = DuplicateRecordFields
  - | NoDuplicateRecordFields
- data FieldSelectors
  - = FieldSelectors
  - | NoFieldSelectors
- flIsOverloaded :: FieldLabel -> Bool

# Documentation

type FieldLabelEnv = DFastStringEnv FieldLabel #

A map from labels to all the auxiliary information

data FieldLabel #

Fields in an algebraic record type; see Note [FieldLabel].

Constructors

FieldLabel |
Fields flHasDuplicateRecordFields :: DuplicateRecordFields Was `DuplicateRecordFields` on in the defining module for this datatype? flHasFieldSelector :: FieldSelectors Was `FieldSelectors` enabled in the defining module for this datatype? See Note [NoFieldSelectors] in GHC.Rename.Env flSelector :: Name The `Name` of the selector function, which uniquely identifies the field label.

#### Instances

Instances details

NFData FieldLabel # |
Instance details Defined in GHC.Types.Name Methods rnf :: FieldLabel -> () #
Data FieldLabel # |
Instance details Defined in GHC.Types.FieldLabel Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldLabel -> c FieldLabel # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldLabel # toConstr :: FieldLabel -> Constr # dataTypeOf :: FieldLabel -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldLabel) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldLabel) # gmapT :: (forall b. Data b => b -> b) -> FieldLabel -> FieldLabel # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldLabel -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldLabel -> r # gmapQ :: (forall d. Data d => d -> u) -> FieldLabel -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldLabel -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldLabel -> m FieldLabel # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldLabel -> m FieldLabel # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldLabel -> m FieldLabel #
HasOccName FieldLabel # |
Instance details Defined in GHC.Types.FieldLabel Methods occName :: FieldLabel -> OccName #
Binary Name => Binary FieldLabel # | We need the `Binary Name` constraint here even though there is an instance defined in GHC.Types.Name, because the we have a SOURCE import, so the instance is not in scope. And the instance cannot be added to Name.hs-boot because GHC.Utils.Binary itself depends on GHC.Types.Name.
Instance details Defined in GHC.Types.FieldLabel Methods put_ :: WriteBinHandle -> FieldLabel -> IO () # put :: WriteBinHandle -> FieldLabel -> IO (Bin FieldLabel) # get :: ReadBinHandle -> IO FieldLabel #
Outputable FieldLabel # |
Instance details Defined in GHC.Types.FieldLabel Methods ppr :: FieldLabel -> SDoc #
Eq FieldLabel # |
Instance details Defined in GHC.Types.FieldLabel Methods (==) :: FieldLabel -> FieldLabel -> Bool # (/=) :: FieldLabel -> FieldLabel -> Bool #

flLabel :: FieldLabel -> FieldLabelString #

User-visible label of a field.

data DuplicateRecordFields #

Flag to indicate whether the DuplicateRecordFields extension is enabled.

Constructors

DuplicateRecordFields | Fields may be duplicated in a single module
NoDuplicateRecordFields | Fields must be unique within a module (the default)

#### Instances

Instances details

NFData DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods rnf :: DuplicateRecordFields -> () #
Data DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DuplicateRecordFields -> c DuplicateRecordFields # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DuplicateRecordFields # toConstr :: DuplicateRecordFields -> Constr # dataTypeOf :: DuplicateRecordFields -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DuplicateRecordFields) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DuplicateRecordFields) # gmapT :: (forall b. Data b => b -> b) -> DuplicateRecordFields -> DuplicateRecordFields # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DuplicateRecordFields -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DuplicateRecordFields -> r # gmapQ :: (forall d. Data d => d -> u) -> DuplicateRecordFields -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DuplicateRecordFields -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DuplicateRecordFields -> m DuplicateRecordFields # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DuplicateRecordFields -> m DuplicateRecordFields # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DuplicateRecordFields -> m DuplicateRecordFields #
Show DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods showsPrec :: Int -> DuplicateRecordFields -> ShowS # show :: DuplicateRecordFields -> String # showList :: [DuplicateRecordFields] -> ShowS #
Binary DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods put_ :: WriteBinHandle -> DuplicateRecordFields -> IO () # put :: WriteBinHandle -> DuplicateRecordFields -> IO (Bin DuplicateRecordFields) # get :: ReadBinHandle -> IO DuplicateRecordFields #
Outputable DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods ppr :: DuplicateRecordFields -> SDoc #
Eq DuplicateRecordFields # |
Instance details Defined in GHC.Types.FieldLabel Methods (==) :: DuplicateRecordFields -> DuplicateRecordFields -> Bool # (/=) :: DuplicateRecordFields -> DuplicateRecordFields -> Bool #

data FieldSelectors #

Flag to indicate whether the FieldSelectors extension is enabled.

Constructors

FieldSelectors | Selector functions are available (the default)
NoFieldSelectors | Selector functions are not available

#### Instances

Instances details

NFData FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods rnf :: FieldSelectors -> () #
Data FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FieldSelectors -> c FieldSelectors # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldSelectors # toConstr :: FieldSelectors -> Constr # dataTypeOf :: FieldSelectors -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldSelectors) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldSelectors) # gmapT :: (forall b. Data b => b -> b) -> FieldSelectors -> FieldSelectors # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldSelectors -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldSelectors -> r # gmapQ :: (forall d. Data d => d -> u) -> FieldSelectors -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldSelectors -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldSelectors -> m FieldSelectors # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldSelectors -> m FieldSelectors # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldSelectors -> m FieldSelectors #
Show FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods showsPrec :: Int -> FieldSelectors -> ShowS # show :: FieldSelectors -> String # showList :: [FieldSelectors] -> ShowS #
Binary FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods put_ :: WriteBinHandle -> FieldSelectors -> IO () # put :: WriteBinHandle -> FieldSelectors -> IO (Bin FieldSelectors) # get :: ReadBinHandle -> IO FieldSelectors #
Outputable FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods ppr :: FieldSelectors -> SDoc #
Eq FieldSelectors # |
Instance details Defined in GHC.Types.FieldLabel Methods (==) :: FieldSelectors -> FieldSelectors -> Bool # (/=) :: FieldSelectors -> FieldSelectors -> Bool #

flIsOverloaded :: FieldLabel -> Bool #

# Orphan instances

Uniquable FieldLabelString # |
Instance details Methods getUnique :: FieldLabelString -> Unique #
Outputable FieldLabelString # |
Instance details Methods ppr :: FieldLabelString -> SDoc #