Language.Haskell.Syntax.Basic

ghc-lib-parser-9.14.1.20251220: 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 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 #

Constructors

Boxed |
Unboxed |

#### Instances

Instances details

Data Boxity # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Boxity # toConstr :: Boxity -> Constr # dataTypeOf :: Boxity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Boxity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Boxity) # gmapT :: (forall b. Data b => b -> b) -> Boxity -> Boxity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Boxity -> r # gmapQ :: (forall d. Data d => d -> u) -> Boxity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Boxity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Boxity -> m Boxity #
Binary Boxity # |
Instance details Defined in GHC.Types.Basic Methods put_ :: WriteBinHandle -> Boxity -> IO () # put :: WriteBinHandle -> Boxity -> IO (Bin Boxity) # get :: ReadBinHandle -> IO Boxity #
Outputable Boxity # |
Instance details Defined in GHC.Types.Basic Methods ppr :: Boxity -> SDoc #
Eq Boxity # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Boxity -> Boxity -> Bool # (/=) :: Boxity -> Boxity -> Bool #

isBoxed :: Boxity -> Bool #

type SumWidth = Int #

The width of an unboxed sum

type ConTag = Int #

A *one-index* constructor tag

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

newtype FieldLabelString #

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 # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods rnf :: FieldLabelString -> () #
Data FieldLabelString # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FieldLabelString # toConstr :: FieldLabelString -> Constr # dataTypeOf :: FieldLabelString -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FieldLabelString) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FieldLabelString) # gmapT :: (forall b. Data b => b -> b) -> FieldLabelString -> FieldLabelString # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FieldLabelString -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FieldLabelString -> r # gmapQ :: (forall d. Data d => d -> u) -> FieldLabelString -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FieldLabelString -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FieldLabelString -> m FieldLabelString # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldLabelString -> m FieldLabelString # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FieldLabelString -> m FieldLabelString #
Uniquable FieldLabelString # |
Instance details Defined in GHC.Types.FieldLabel Methods getUnique :: FieldLabelString -> Unique #
Outputable FieldLabelString # |
Instance details Defined in GHC.Types.FieldLabel Methods ppr :: FieldLabelString -> SDoc #
Eq FieldLabelString # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: FieldLabelString -> FieldLabelString -> Bool # (/=) :: FieldLabelString -> FieldLabelString -> Bool #
type Anno FieldLabelString # |
Instance details Defined in GHC.Hs.Expr type Anno FieldLabelString = SrcSpanAnnN

data Role #

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

NFData Role # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods rnf :: Role -> () #
Data Role # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Role # toConstr :: Role -> Constr # dataTypeOf :: Role -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Role) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Role) # gmapT :: (forall b. Data b => b -> b) -> Role -> Role # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Role -> r # gmapQ :: (forall d. Data d => d -> u) -> Role -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Role -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Role -> m Role #
Binary Role # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods put_ :: WriteBinHandle -> Role -> IO () # put :: WriteBinHandle -> Role -> IO (Bin Role) # get :: ReadBinHandle -> IO Role #
Outputable Role # |
Instance details Defined in GHC.Core.Coercion.Axiom Methods ppr :: Role -> SDoc #
Eq Role # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Role -> Role -> Bool # (/=) :: Role -> Role -> Bool #
Ord Role # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods compare :: Role -> Role -> Ordering # (<) :: Role -> Role -> Bool # (<=) :: Role -> Role -> Bool # (>) :: Role -> Role -> Bool # (>=) :: Role -> Role -> Bool # max :: Role -> Role -> Role # min :: Role -> Role -> Role #
type Anno (Maybe Role) # |
Instance details Defined in GHC.Hs.Decls type Anno (Maybe Role) = EpAnnCO

data SrcStrictness #

Source Strictness

What strictness annotation the user wrote

Constructors

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

#### Instances

Instances details

NFData SrcStrictness # |
Instance details Defined in GHC.Core.DataCon Methods rnf :: SrcStrictness -> () #
Data SrcStrictness # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcStrictness # toConstr :: SrcStrictness -> Constr # dataTypeOf :: SrcStrictness -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SrcStrictness) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcStrictness) # gmapT :: (forall b. Data b => b -> b) -> SrcStrictness -> SrcStrictness # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcStrictness -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcStrictness -> r # gmapQ :: (forall d. Data d => d -> u) -> SrcStrictness -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcStrictness -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcStrictness -> m SrcStrictness # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcStrictness -> m SrcStrictness # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcStrictness -> m SrcStrictness #
Binary SrcStrictness # |
Instance details Defined in GHC.Core.DataCon Methods put_ :: WriteBinHandle -> SrcStrictness -> IO () # put :: WriteBinHandle -> SrcStrictness -> IO (Bin SrcStrictness) # get :: ReadBinHandle -> IO SrcStrictness #
Outputable SrcStrictness # |
Instance details Defined in GHC.Core.DataCon Methods ppr :: SrcStrictness -> SDoc #
Eq SrcStrictness # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: SrcStrictness -> SrcStrictness -> Bool # (/=) :: SrcStrictness -> SrcStrictness -> Bool #

data SrcUnpackedness #

Source Unpackedness

What unpackedness the user requested

Constructors

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

#### Instances

Instances details

NFData SrcUnpackedness # |
Instance details Defined in GHC.Core.DataCon Methods rnf :: SrcUnpackedness -> () #
Data SrcUnpackedness # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcUnpackedness # toConstr :: SrcUnpackedness -> Constr # dataTypeOf :: SrcUnpackedness -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SrcUnpackedness) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcUnpackedness) # gmapT :: (forall b. Data b => b -> b) -> SrcUnpackedness -> SrcUnpackedness # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcUnpackedness -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcUnpackedness -> r # gmapQ :: (forall d. Data d => d -> u) -> SrcUnpackedness -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcUnpackedness -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcUnpackedness -> m SrcUnpackedness # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcUnpackedness -> m SrcUnpackedness # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcUnpackedness -> m SrcUnpackedness #
Binary SrcUnpackedness # |
Instance details Defined in GHC.Core.DataCon Methods put_ :: WriteBinHandle -> SrcUnpackedness -> IO () # put :: WriteBinHandle -> SrcUnpackedness -> IO (Bin SrcUnpackedness) # get :: ReadBinHandle -> IO SrcUnpackedness #
Outputable SrcUnpackedness # |
Instance details Defined in GHC.Core.DataCon Methods ppr :: SrcUnpackedness -> SDoc #
Eq SrcUnpackedness # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: SrcUnpackedness -> SrcUnpackedness -> Bool # (/=) :: SrcUnpackedness -> SrcUnpackedness -> Bool #

data LexicalFixity #

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 # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c LexicalFixity # toConstr :: LexicalFixity -> Constr # dataTypeOf :: LexicalFixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c LexicalFixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c LexicalFixity) # gmapT :: (forall b. Data b => b -> b) -> LexicalFixity -> LexicalFixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LexicalFixity -> r # gmapQ :: (forall d. Data d => d -> u) -> LexicalFixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> LexicalFixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LexicalFixity -> m LexicalFixity #
Outputable LexicalFixity # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: LexicalFixity -> SDoc #
Eq LexicalFixity # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: LexicalFixity -> LexicalFixity -> Bool # (/=) :: LexicalFixity -> LexicalFixity -> Bool #

data FixityDirection #

Constructors

InfixL |
InfixR |
InfixN |

#### Instances

Instances details

NFData FixityDirection # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods rnf :: FixityDirection -> () #
Data FixityDirection # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FixityDirection # toConstr :: FixityDirection -> Constr # dataTypeOf :: FixityDirection -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FixityDirection) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FixityDirection) # gmapT :: (forall b. Data b => b -> b) -> FixityDirection -> FixityDirection # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FixityDirection -> r # gmapQ :: (forall d. Data d => d -> u) -> FixityDirection -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FixityDirection -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FixityDirection -> m FixityDirection #
Binary FixityDirection # |
Instance details Defined in GHC.Hs.Basic Methods put_ :: WriteBinHandle -> FixityDirection -> IO () # put :: WriteBinHandle -> FixityDirection -> IO (Bin FixityDirection) # get :: ReadBinHandle -> IO FixityDirection #
Outputable FixityDirection # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: FixityDirection -> SDoc #
Eq FixityDirection # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: FixityDirection -> FixityDirection -> Bool # (/=) :: FixityDirection -> FixityDirection -> Bool #

data Fixity #

Constructors

Fixity Int FixityDirection |

#### Instances

Instances details

NFData Fixity # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods rnf :: Fixity -> () #
Data Fixity # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Fixity # toConstr :: Fixity -> Constr # dataTypeOf :: Fixity -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Fixity) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Fixity) # gmapT :: (forall b. Data b => b -> b) -> Fixity -> Fixity # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Fixity -> r # gmapQ :: (forall d. Data d => d -> u) -> Fixity -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Fixity -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Fixity -> m Fixity #
Binary Fixity # |
Instance details Defined in GHC.Hs.Basic Methods put_ :: WriteBinHandle -> Fixity -> IO () # put :: WriteBinHandle -> Fixity -> IO (Bin Fixity) # get :: ReadBinHandle -> IO Fixity #
Outputable Fixity # |
Instance details Defined in GHC.Hs.Basic Methods ppr :: Fixity -> SDoc #
Eq Fixity # |
Instance details Defined in Language.Haskell.Syntax.Basic Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #