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

Safe Haskell | Ignore
Language | GHC2021

Language.Haskell.Syntax

Synopsis

- module Language.Haskell.Syntax.Binds
- module Language.Haskell.Syntax.Decls
- module Language.Haskell.Syntax.Expr
- module Language.Haskell.Syntax.ImpExp
- module Language.Haskell.Syntax.Lit
- module Language.Haskell.Syntax.Module.Name
- module Language.Haskell.Syntax.Pat
- module Language.Haskell.Syntax.Type
- module Language.Haskell.Syntax.Extension
- newtype ModuleName = ModuleName FastString
- 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)

# Documentation

module Language.Haskell.Syntax.Binds

module Language.Haskell.Syntax.Decls

module Language.Haskell.Syntax.Expr

module Language.Haskell.Syntax.ImpExp

module Language.Haskell.Syntax.Lit

module Language.Haskell.Syntax.Module.Name

module Language.Haskell.Syntax.Pat

module Language.Haskell.Syntax.Type

module Language.Haskell.Syntax.Extension

newtype ModuleName #

A ModuleName is essentially a simple string, e.g. `Data.List`.

Constructors

ModuleName FastString |

#### Instances

Instances details

NFData ModuleName # |
Instance details Defined in Language.Haskell.Syntax.Module.Name Methods rnf :: ModuleName -> () #
Data ModuleName # |

Instance details

Defined in Language.Haskell.Syntax.Module.Name

Methods

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

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

toConstr :: ModuleName -> Constr #

dataTypeOf :: ModuleName -> DataType #

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

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

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

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

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

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

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

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

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

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

Show ModuleName # |
Instance details Defined in Language.Haskell.Syntax.Module.Name Methods showsPrec :: Int -> ModuleName -> ShowS # show :: ModuleName -> String # showList :: [ModuleName] -> ShowS #
Uniquable ModuleName # |
Instance details Defined in GHC.Types.Unique Methods getUnique :: ModuleName -> Unique #
Binary ModuleName # |
Instance details Defined in GHC.Utils.Binary Methods put_ :: BinHandle -> ModuleName -> IO () # put :: BinHandle -> ModuleName -> IO (Bin ModuleName) # get :: BinHandle -> IO ModuleName #
Outputable ModuleName # |
Instance details Defined in GHC.Utils.Outputable Methods ppr :: ModuleName -> SDoc #
Eq ModuleName # |
Instance details Defined in Language.Haskell.Syntax.Module.Name Methods (==) :: ModuleName -> ModuleName -> Bool # (/=) :: ModuleName -> ModuleName -> Bool #
Ord ModuleName # |
Instance details Defined in Language.Haskell.Syntax.Module.Name Methods compare :: ModuleName -> ModuleName -> Ordering # (<) :: ModuleName -> ModuleName -> Bool # (<=) :: ModuleName -> ModuleName -> Bool # (>) :: ModuleName -> ModuleName -> Bool # (>=) :: ModuleName -> ModuleName -> Bool # max :: ModuleName -> ModuleName -> ModuleName # min :: ModuleName -> ModuleName -> ModuleName #
type Anno ModuleName # |
Instance details Defined in GHC.Hs.ImpExp type Anno ModuleName = SrcSpanAnnA
type Anno ModuleName # |
Instance details Defined in GHC.Hs type Anno ModuleName = SrcSpanAnnA

data HsModule p #

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) # |

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) #

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

toConstr :: HsModule GhcPs -> Constr #

dataTypeOf :: HsModule GhcPs -> DataType #

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

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

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

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

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

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

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

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

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

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

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