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

Safe Haskell | Ignore
Language | GHC2021

Language.Haskell.Syntax.Basic

Synopsis

- data Boxity
  - = Boxed
  - | Unboxed
- isBoxed :: Boxity -> Bool
- type SumWidth = Int
- type ConTag = Int
- newtype FieldLabelString = FieldLabelString {
  - field_label :: FastString
  }
- data Role
  - = Nominal
  - | Representational
  - | Phantom
- data HsBang = HsBang SrcUnpackedness SrcStrictness
- data SrcStrictness
  - = SrcLazy
  - | SrcStrict
  - | NoSrcStrict
- data SrcUnpackedness
  - = SrcUnpack
  - | SrcNoUnpack
  - | NoSrcUnpack
- data LexicalFixity
  - = Prefix
  - | Infix
- data FixityDirection
  - = InfixL
  - | InfixR
  - | InfixN
- data Fixity = Fixity Int FixityDirection

# Documentation

data Boxity Source #

Constructors

Boxed |
Unboxed |

#### Instances

Instances details

Data Boxity Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: Boxity -> Constr Source #

dataTypeOf :: Boxity -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary Boxity Source # |
Instance details Defined in GHC.Types.Basic Methods put_ :: WriteBinHandle -> Boxity -> IO () Source # put :: WriteBinHandle -> Boxity -> IO (Bin Boxity) Source # get :: ReadBinHandle -> IO Boxity Source #
Outputable Boxity Source # |
Instance details Defined in GHC.Types.Basic Methods ppr :: Boxity -> SDoc Source #
Eq Boxity Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Boxity -> Boxity -> Bool Source # (/=) :: Boxity -> Boxity -> Bool Source #

isBoxed :: Boxity -> Bool Source #

type SumWidth = Int Source #

The width of an unboxed sum

type ConTag = Int Source #

A *one-index* constructor tag

Type of the tags associated with each constructor possibility or superclass selector

newtype FieldLabelString Source #

Field labels are just represented as strings; they are not necessarily unique (even within a module)

Constructors

FieldLabelString |

Fields

- field_label :: FastString

#### Instances

Instances details

NFData FieldLabelString Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods rnf :: FieldLabelString -> () Source #
Data FieldLabelString Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: FieldLabelString -> Constr Source #

dataTypeOf :: FieldLabelString -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Uniquable FieldLabelString Source # |
Instance details Defined in GHC.Types.FieldLabel Methods getUnique :: FieldLabelString -> Unique Source #
Outputable FieldLabelString Source # |
Instance details Defined in GHC.Types.FieldLabel Methods ppr :: FieldLabelString -> SDoc Source #
Eq FieldLabelString Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: FieldLabelString -> FieldLabelString -> Bool Source # (/=) :: FieldLabelString -> FieldLabelString -> Bool Source #
type Anno FieldLabelString Source # |
Instance details Defined in GHC.Hs.Expr type Anno FieldLabelString = SrcSpanAnnN

data Role Source #

See Note [Roles] in GHC.Core.Coercion

Order of constructors matters: the Ord instance coincides with the *super*typing relation on roles.

Constructors

Nominal |
Representational |
Phantom |

#### Instances

Instances details

Data Role Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: Role -> Constr Source #

dataTypeOf :: Role -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary Role Source # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods put_ :: WriteBinHandle -> Role -> IO () Source # put :: WriteBinHandle -> Role -> IO (Bin Role) Source # get :: ReadBinHandle -> IO Role Source #
Outputable Role Source # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods ppr :: Role -> SDoc Source #
Eq Role Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Role -> Role -> Bool Source # (/=) :: Role -> Role -> Bool Source #
Ord Role Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods compare :: Role -> Role -> Ordering Source # (<) :: Role -> Role -> Bool Source # (<=) :: Role -> Role -> Bool Source # (>) :: Role -> Role -> Bool Source # (>=) :: Role -> Role -> Bool Source # max :: Role -> Role -> Role Source # min :: Role -> Role -> Role Source #
type Anno (Maybe Role) Source # |
Instance details Defined in GHC.Hs.Decls type Anno (Maybe Role) = EpAnnCO

data HsBang Source #

Haskell Bang

Bangs on data constructor arguments written by the user.

`(HsBang SrcUnpack SrcLazy)` and `(HsBang SrcUnpack NoSrcStrict)` (without StrictData) makes no sense, we emit a warning (in checkValidDataCon) and treat it like `(HsBang NoSrcUnpack SrcLazy)`

`HsSrcBang` is a wrapper around this, associating it with a `SourceText` as written by the user. In the AST, the `SourceText` is hidden inside the extension point `XBangTy`.

Constructors

HsBang SrcUnpackedness SrcStrictness |

#### Instances

Instances details

Data HsBang Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: HsBang -> Constr Source #

dataTypeOf :: HsBang -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable HsBang Source # |
Instance details Defined in GHC.Core.DataCon Methods ppr :: HsBang -> SDoc Source #

data SrcStrictness Source #

Source Strictness

What strictness annotation the user wrote

Constructors

SrcLazy | Lazy, ie `~`
SrcStrict | Strict, ie `!`
NoSrcStrict | no strictness annotation

#### Instances

Instances details

Data SrcStrictness Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: SrcStrictness -> Constr Source #

dataTypeOf :: SrcStrictness -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary SrcStrictness Source # |
Instance details Defined in GHC.Core.DataCon Methods put_ :: WriteBinHandle -> SrcStrictness -> IO () Source # put :: WriteBinHandle -> SrcStrictness -> IO (Bin SrcStrictness) Source # get :: ReadBinHandle -> IO SrcStrictness Source #
Outputable SrcStrictness Source # |
Instance details Defined in GHC.Core.DataCon Methods ppr :: SrcStrictness -> SDoc Source #
Eq SrcStrictness Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: SrcStrictness -> SrcStrictness -> Bool Source # (/=) :: SrcStrictness -> SrcStrictness -> Bool Source #

data SrcUnpackedness Source #

Source Unpackedness

What unpackedness the user requested

Constructors

SrcUnpack | {-# UNPACK #-} specified
SrcNoUnpack | {-# NOUNPACK #-} specified
NoSrcUnpack | no unpack pragma

#### Instances

Instances details

Data SrcUnpackedness Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: SrcUnpackedness -> Constr Source #

dataTypeOf :: SrcUnpackedness -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary SrcUnpackedness Source # |
Instance details Defined in GHC.Core.DataCon Methods put_ :: WriteBinHandle -> SrcUnpackedness -> IO () Source # put :: WriteBinHandle -> SrcUnpackedness -> IO (Bin SrcUnpackedness) Source # get :: ReadBinHandle -> IO SrcUnpackedness Source #
Outputable SrcUnpackedness Source # |
Instance details Defined in GHC.Core.DataCon Methods ppr :: SrcUnpackedness -> SDoc Source #
Eq SrcUnpackedness Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: SrcUnpackedness -> SrcUnpackedness -> Bool Source # (/=) :: SrcUnpackedness -> SrcUnpackedness -> Bool Source #

data LexicalFixity Source #

Captures the fixity of declarations as they are parsed. This is not necessarily the same as the fixity declaration, as the normal fixity may be overridden using parens or backticks.

Constructors

Prefix |
Infix |

#### Instances

Instances details

Data LexicalFixity Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: LexicalFixity -> Constr Source #

dataTypeOf :: LexicalFixity -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable LexicalFixity Source # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: LexicalFixity -> SDoc Source #
Eq LexicalFixity Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: LexicalFixity -> LexicalFixity -> Bool Source # (/=) :: LexicalFixity -> LexicalFixity -> Bool Source #

data FixityDirection Source #

Constructors

InfixL |
InfixR |
InfixN |

#### Instances

Instances details

Data FixityDirection Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: FixityDirection -> Constr Source #

dataTypeOf :: FixityDirection -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary FixityDirection Source # |
Instance details Defined in GHC.Hs.Basic Methods put_ :: WriteBinHandle -> FixityDirection -> IO () Source # put :: WriteBinHandle -> FixityDirection -> IO (Bin FixityDirection) Source # get :: ReadBinHandle -> IO FixityDirection Source #
Outputable FixityDirection Source # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: FixityDirection -> SDoc Source #
Eq FixityDirection Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: FixityDirection -> FixityDirection -> Bool Source # (/=) :: FixityDirection -> FixityDirection -> Bool Source #

data Fixity Source #

Constructors

Fixity Int FixityDirection |

#### Instances

Instances details

Data Fixity Source # |

Instance details

Defined in Language.Haskell.Syntax.Basic

Methods

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

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

toConstr :: Fixity -> Constr Source #

dataTypeOf :: Fixity -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Binary Fixity Source # |
Instance details Defined in GHC.Hs.Basic Methods put_ :: WriteBinHandle -> Fixity -> IO () Source # put :: WriteBinHandle -> Fixity -> IO (Bin Fixity) Source # get :: ReadBinHandle -> IO Fixity Source #
Outputable Fixity Source # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: Fixity -> SDoc Source #
Eq Fixity Source # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Fixity -> Fixity -> Bool Source # (/=) :: Fixity -> Fixity -> Bool Source #