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

Safe Haskell | Ignore
Language | GHC2021

GHC.Hs.ImpExp

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax.ImpExp
- importDeclQualifiedStyle :: Maybe (EpToken "qualified") -> Maybe (EpToken "qualified") -> (Maybe (EpToken "qualified"), ImportDeclQualifiedStyle)
- isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
- data XImportDeclPass = XImportDeclPass {
  - ideclAnn :: EpAnn EpAnnImportDecl
  - ideclSourceText :: SourceText
  - ideclImplicit :: Bool
  }
- data EpAnnImportDecl = EpAnnImportDecl {
  - importDeclAnnImport :: EpToken "import"
  - importDeclAnnPragma :: Maybe (EpaLocation, EpToken "#-}")
  - importDeclAnnSafe :: Maybe (EpToken "safe")
  - importDeclAnnQualified :: Maybe (EpToken "qualified")
  - importDeclAnnPackage :: Maybe EpaLocation
  - importDeclAnnAs :: Maybe (EpToken "as")
  }
- simpleImportDecl :: ModuleName -> ImportDecl GhcPs
- type IEThingWithAnns = (EpToken "(", EpToken "..", EpToken ",", EpToken ")")
- ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
- ieWrappedName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> IdP (GhcPass p)
- ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
- ieDeprecation :: forall (p :: Pass). IsPass p => IE (GhcPass p) -> Maybe (WarningTxt (GhcPass p))
- ieWrappedLName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- lieWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> IdP (GhcPass p)
- ieLWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- replaceWrappedName :: IEWrappedName GhcPs -> IdP GhcRn -> IEWrappedName GhcRn
- replaceLWrappedName :: LIEWrappedName GhcPs -> IdP GhcRn -> LIEWrappedName GhcRn
- exportDocstring :: LHsDoc pass -> SDoc
- pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc

# Documentation

module Language.Haskell.Syntax.ImpExp

importDeclQualifiedStyle :: Maybe (EpToken "qualified") -> Maybe (EpToken "qualified") -> (Maybe (EpToken "qualified"), ImportDeclQualifiedStyle) Source #

Given two possible located `qualified` tokens, compute a style (in a conforming Haskell program only one of the two can be not `Nothing`). This is called from GHC.Parser.

isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool Source #

Convenience function to answer the question if an import decl. is qualified.

data XImportDeclPass Source #

Constructors

XImportDeclPass |

Fields

- ideclAnn :: EpAnn EpAnnImportDecl
- ideclSourceText :: SourceText
- ideclImplicit :: Bool

  GHC generates an `ImportDecl` to represent the invisible `import Prelude` that appears in any file that omits `import Prelude`, setting this field to indicate that the import doesn't appear in the original source. True => implicit import (of Prelude)

#### Instances

Instances details

Data XImportDeclPass Source # |

Instance details

Defined in GHC.Hs.ImpExp

Methods

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

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

toConstr :: XImportDeclPass -> Constr Source #

dataTypeOf :: XImportDeclPass -> DataType Source #

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

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

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

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

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

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

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

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

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

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

data EpAnnImportDecl Source #

Constructors

EpAnnImportDecl |

Fields

- importDeclAnnImport :: EpToken "import"

  The location of the `import` keyword

- importDeclAnnPragma :: Maybe (EpaLocation, EpToken "#-}")

  The locations of `{-# SOURCE` and `#-}` respectively

- importDeclAnnSafe :: Maybe (EpToken "safe")

  The location of the `safe` keyword

- importDeclAnnQualified :: Maybe (EpToken "qualified")

  The location of the `qualified` keyword

- importDeclAnnPackage :: Maybe EpaLocation

  The location of the package name (when using `-XPackageImports`)

- importDeclAnnAs :: Maybe (EpToken "as")

  The location of the `as` keyword

#### Instances

Instances details

Data EpAnnImportDecl Source # |

Instance details

Defined in GHC.Hs.ImpExp

Methods

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

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

toConstr :: EpAnnImportDecl -> Constr Source #

dataTypeOf :: EpAnnImportDecl -> DataType Source #

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

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

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

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

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

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

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

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

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

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

NoAnn EpAnnImportDecl Source # |
Instance details Defined in GHC.Hs.ImpExp Methods noAnn :: EpAnnImportDecl Source #

simpleImportDecl :: ModuleName -> ImportDecl GhcPs Source #

type IEThingWithAnns = (EpToken "(", EpToken "..", EpToken ",", EpToken ")") Source #

ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p) Source #

ieWrappedName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> IdP (GhcPass p) Source #

ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)] Source #

ieDeprecation :: forall (p :: Pass). IsPass p => IE (GhcPass p) -> Maybe (WarningTxt (GhcPass p)) Source #

ieWrappedLName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> LIdP (GhcPass p) Source #

lieWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> IdP (GhcPass p) Source #

ieLWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> LIdP (GhcPass p) Source #

replaceWrappedName :: IEWrappedName GhcPs -> IdP GhcRn -> IEWrappedName GhcRn Source #

replaceLWrappedName :: LIEWrappedName GhcPs -> IdP GhcRn -> LIEWrappedName GhcRn Source #

exportDocstring :: LHsDoc pass -> SDoc Source #

pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc Source #

# Orphan instances

Data (IEWrappedName GhcPs) Source # |

Instance details

Methods

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

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

toConstr :: IEWrappedName GhcPs -> Constr Source #

dataTypeOf :: IEWrappedName GhcPs -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Data (IEWrappedName GhcRn) Source # |

Instance details

Methods

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

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

toConstr :: IEWrappedName GhcRn -> Constr Source #

dataTypeOf :: IEWrappedName GhcRn -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Data (IEWrappedName GhcTc) Source # |

Instance details

Methods

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

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

toConstr :: IEWrappedName GhcTc -> Constr Source #

dataTypeOf :: IEWrappedName GhcTc -> DataType Source #

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

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

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

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

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

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

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

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

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

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

(HasOccName (IdP (GhcPass p)), OutputableBndrId p) => HasOccName (IEWrappedName (GhcPass p)) Source # |
Instance details Methods occName :: IEWrappedName (GhcPass p) -> OccName Source #
OutputableBndrId p => Outputable (IE (GhcPass p)) Source # |
Instance details Methods ppr :: IE (GhcPass p) -> SDoc Source #
OutputableBndrId p => Outputable (IEWrappedName (GhcPass p)) Source # |
Instance details Methods ppr :: IEWrappedName (GhcPass p) -> SDoc Source #
(OutputableBndrId p, Outputable (Anno (IE (GhcPass p))), Outputable (ImportDeclPkgQual (GhcPass p))) => Outputable (ImportDecl (GhcPass p)) Source # |
Instance details Methods ppr :: ImportDecl (GhcPass p) -> SDoc Source #
OutputableBndrId p => OutputableBndr (IEWrappedName (GhcPass p)) Source # |
Instance details Methods pprBndr :: BindingSite -> IEWrappedName (GhcPass p) -> SDoc Source # pprPrefixOcc :: IEWrappedName (GhcPass p) -> SDoc Source # pprInfixOcc :: IEWrappedName (GhcPass p) -> SDoc Source # bndrIsJoin_maybe :: IEWrappedName (GhcPass p) -> JoinPointHood Source #
Eq (IEWrappedName GhcPs) Source # |
Instance details Methods (==) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool Source # (/=) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool Source #
Eq (IEWrappedName GhcRn) Source # |
Instance details Methods (==) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool Source # (/=) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool Source #
Eq (IEWrappedName GhcTc) Source # |
Instance details Methods (==) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool Source # (/=) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool Source #