ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Hs

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax
- module GHC.Hs.Binds
- module GHC.Hs.Decls
- module GHC.Hs.Expr
- module GHC.Hs.ImpExp
- module GHC.Hs.Lit
- module GHC.Hs.Pat
- module GHC.Hs.Type
- module GHC.Hs.Utils
- module GHC.Hs.Doc
- module GHC.Hs.Extension
- module GHC.Parser.Annotation
- data Fixity
- data HsModule p
  - = HsModule {
    - hsmodExt :: XCModule p
    - hsmodName :: Maybe (XRec p ModuleName)
    - hsmodExports :: Maybe (XRec p [LIE p])
    - hsmodImports :: [LImportDecl p]
    - hsmodDecls :: [LHsDecl p]
    }
  - | XModule !(XXModule p)
- data AnnsModule = AnnsModule {
  - am_main :: [AddEpAnn]
  - am_decls :: AnnList
  }
- data HsParsedModule = HsParsedModule {
  - hpm_module :: Located (HsModule GhcPs)
  - hpm_src_files :: [FilePath]
  }
- data XModulePs = XModulePs {
  - hsmodAnn :: EpAnn AnnsModule
  - hsmodLayout :: LayoutInfo GhcPs
  - hsmodDeprecMessage :: Maybe (LocatedP (WarningTxt GhcPs))
  - hsmodHaddockModHeader :: Maybe (LHsDoc GhcPs)
  }

# Documentation

module Language.Haskell.Syntax

module GHC.Hs.Binds

module GHC.Hs.Decls

module GHC.Hs.Expr

module GHC.Hs.ImpExp

module GHC.Hs.Lit

module GHC.Hs.Pat

module GHC.Hs.Type

module GHC.Hs.Utils

module GHC.Hs.Doc

module GHC.Hs.Extension

module GHC.Parser.Annotation

data Fixity Source #

#### Instances

Instances details

Data Fixity Source # |

Instance details

Defined in GHC.Types.Fixity

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.Types.Fixity Methods put_ :: BinHandle -> Fixity -> IO () Source # put :: BinHandle -> Fixity -> IO (Bin Fixity) Source # get :: BinHandle -> IO Fixity Source #
Outputable Fixity Source # |
Instance details Defined in GHC.Types.Fixity Methods ppr :: Fixity -> SDoc Source #
Eq Fixity Source # |
Instance details Defined in GHC.Types.Fixity Methods (==) :: Fixity -> Fixity -> Bool # (/=) :: Fixity -> Fixity -> Bool #

data HsModule p Source #

Haskell Module

All we actually declare here is the top-level structure for a module.

Constructors

HsModule

`AnnKeywordId`s

- `AnnModule`,`AnnWhere`
- `AnnOpen`,`AnnSemi`, `AnnClose` for explicit braces and semi around hsmodImports,hsmodDecls if this style is used.

Fields

- hsmodExt :: XCModule p

  HsModule extension point

- hsmodName :: Maybe (XRec p ModuleName)

  `Nothing`: "module X where" is omitted (in which case the next field is Nothing too)

- hsmodExports :: Maybe (XRec p [LIE p])

  Export list

  - `Nothing`: export list omitted, so export everything
  - `Just []`: export nothing
  - `Just [...]`: as you would expect...
  - `AnnKeywordId`s : `AnnOpen` ,`AnnClose`
- hsmodImports :: [LImportDecl p]
- hsmodDecls :: [LHsDecl p]

  Type, class, value, and interface signature decls

XModule !(XXModule p) |

#### Instances

Instances details

Data (HsModule GhcPs) Source # |

Instance details

Defined in GHC.Hs

Methods

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

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

toConstr :: HsModule GhcPs -> Constr Source #

dataTypeOf :: HsModule GhcPs -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable (HsModule GhcPs) Source # |
Instance details Defined in GHC.Hs Methods ppr :: HsModule GhcPs -> SDoc Source #

data AnnsModule Source #

Constructors

AnnsModule |

Fields

- am_main :: [AddEpAnn]
- am_decls :: AnnList

#### Instances

Instances details

Data AnnsModule Source # |

Instance details

Defined in GHC.Hs

Methods

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

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

toConstr :: AnnsModule -> Constr Source #

dataTypeOf :: AnnsModule -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Eq AnnsModule Source # |
Instance details Defined in GHC.Hs Methods (==) :: AnnsModule -> AnnsModule -> Bool # (/=) :: AnnsModule -> AnnsModule -> Bool #

data HsParsedModule Source #

Constructors

HsParsedModule |

Fields

- hpm_module :: Located (HsModule GhcPs)
- hpm_src_files :: [FilePath]

  extra source files (e.g. from #includes). The lexer collects these from '# file line' pragmas, which the C preprocessor leaves behind. These files and their timestamps are stored in the .hi file, so that we can force recompilation if any of them change (#3589)

data XModulePs Source #

Haskell Module extension point: GHC specific

Constructors

XModulePs |

Fields

- hsmodAnn :: EpAnn AnnsModule
- hsmodLayout :: LayoutInfo GhcPs

  Layout info for the module. For incomplete modules (e.g. the output of parseHeader), it is NoLayoutInfo.

- hsmodDeprecMessage :: Maybe (LocatedP (WarningTxt GhcPs))

  reason/explanation for warning/deprecation of this module

  - `AnnKeywordId`s : `AnnOpen` ,`AnnClose`
- hsmodHaddockModHeader :: Maybe (LHsDoc GhcPs)

  Haddock module info and description, unparsed

  - `AnnKeywordId`s : `AnnOpen` ,`AnnClose`

#### Instances

Instances details

Data XModulePs Source # |

Instance details

Defined in GHC.Hs

Methods

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

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

toConstr :: XModulePs -> Constr Source #

dataTypeOf :: XModulePs -> DataType Source #

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

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

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

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

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

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

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

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

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

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

# Orphan instances

Data (HsModule GhcPs) Source # |

Instance details

Methods

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

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

toConstr :: HsModule GhcPs -> Constr Source #

dataTypeOf :: HsModule GhcPs -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Outputable (HsModule GhcPs) Source # |
Instance details Methods ppr :: HsModule GhcPs -> SDoc Source #