GHC.Hs.ImpExp

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

Safe Haskell | Ignore
Language | GHC2021

GHC.Hs.ImpExp

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax.ImpExp
- 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")
  - importDeclAnnLevel :: Maybe EpAnnLevel
  - importDeclAnnQualified :: Maybe (EpToken "qualified")
  - importDeclAnnPackage :: Maybe EpaLocation
  - importDeclAnnAs :: Maybe (EpToken "as")
  }
- data EpAnnLevel
  - = EpAnnLevelSplice (EpToken "splice")
  - | EpAnnLevelQuote (EpToken "quote")
- simpleImportDecl :: ModuleName -> ImportDecl GhcPs
- type IEThingWithAnns = (EpToken "(", EpToken "..", EpToken ",", EpToken ")")
- ieLIEWrappedName :: forall (p :: Pass). IE (GhcPass p) -> LIEWrappedName (GhcPass p)
- ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
- lieWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> IdP (GhcPass p)
- ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
- ieWrappedName :: forall (p :: Pass). IEWrappedName (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)
- 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

isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool #

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

data XImportDeclPass #

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 # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c XImportDeclPass # toConstr :: XImportDeclPass -> Constr # dataTypeOf :: XImportDeclPass -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c XImportDeclPass) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c XImportDeclPass) # gmapT :: (forall b. Data b => b -> b) -> XImportDeclPass -> XImportDeclPass # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> XImportDeclPass -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> XImportDeclPass -> r # gmapQ :: (forall d. Data d => d -> u) -> XImportDeclPass -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> XImportDeclPass -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> XImportDeclPass -> m XImportDeclPass # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> XImportDeclPass -> m XImportDeclPass # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> XImportDeclPass -> m XImportDeclPass #

data EpAnnImportDecl #

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 importDeclAnnLevel :: Maybe EpAnnLevel The location of the `splice` or `quote` 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 # |
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 # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EpAnnImportDecl # toConstr :: EpAnnImportDecl -> Constr # dataTypeOf :: EpAnnImportDecl -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EpAnnImportDecl) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EpAnnImportDecl) # gmapT :: (forall b. Data b => b -> b) -> EpAnnImportDecl -> EpAnnImportDecl # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EpAnnImportDecl -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EpAnnImportDecl -> r # gmapQ :: (forall d. Data d => d -> u) -> EpAnnImportDecl -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> EpAnnImportDecl -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EpAnnImportDecl -> m EpAnnImportDecl # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EpAnnImportDecl -> m EpAnnImportDecl # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EpAnnImportDecl -> m EpAnnImportDecl #
NoAnn EpAnnImportDecl # |
Instance details Defined in GHC.Hs.ImpExp Methods noAnn :: EpAnnImportDecl #

data EpAnnLevel #

Constructors

EpAnnLevelSplice (EpToken "splice") |
EpAnnLevelQuote (EpToken "quote") |

#### Instances

Instances details

Data EpAnnLevel # |
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) -> EpAnnLevel -> c EpAnnLevel # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EpAnnLevel # toConstr :: EpAnnLevel -> Constr # dataTypeOf :: EpAnnLevel -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EpAnnLevel) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EpAnnLevel) # gmapT :: (forall b. Data b => b -> b) -> EpAnnLevel -> EpAnnLevel # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EpAnnLevel -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EpAnnLevel -> r # gmapQ :: (forall d. Data d => d -> u) -> EpAnnLevel -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> EpAnnLevel -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EpAnnLevel -> m EpAnnLevel # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EpAnnLevel -> m EpAnnLevel # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EpAnnLevel -> m EpAnnLevel #
HasLoc EpAnnLevel # |
Instance details Defined in GHC.Hs.ImpExp Methods getHasLoc :: EpAnnLevel -> SrcSpan #

simpleImportDecl :: ModuleName -> ImportDecl GhcPs #

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

ieLIEWrappedName :: forall (p :: Pass). IE (GhcPass p) -> LIEWrappedName (GhcPass p) #

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

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

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

ieWrappedName :: forall (p :: Pass). IEWrappedName (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) #

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 #

# Orphan instances

Data (IEWrappedName GhcPs) # |
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) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IEWrappedName GhcPs) # toConstr :: IEWrappedName GhcPs -> Constr # dataTypeOf :: IEWrappedName GhcPs -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IEWrappedName GhcPs)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IEWrappedName GhcPs)) # gmapT :: (forall b. Data b => b -> b) -> IEWrappedName GhcPs -> IEWrappedName GhcPs # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcPs -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcPs -> r # gmapQ :: (forall d. Data d => d -> u) -> IEWrappedName GhcPs -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IEWrappedName GhcPs -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IEWrappedName GhcPs -> m (IEWrappedName GhcPs) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcPs -> m (IEWrappedName GhcPs) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcPs -> m (IEWrappedName GhcPs) #
Data (IEWrappedName GhcRn) # |
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) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IEWrappedName GhcRn) # toConstr :: IEWrappedName GhcRn -> Constr # dataTypeOf :: IEWrappedName GhcRn -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IEWrappedName GhcRn)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IEWrappedName GhcRn)) # gmapT :: (forall b. Data b => b -> b) -> IEWrappedName GhcRn -> IEWrappedName GhcRn # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcRn -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcRn -> r # gmapQ :: (forall d. Data d => d -> u) -> IEWrappedName GhcRn -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IEWrappedName GhcRn -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IEWrappedName GhcRn -> m (IEWrappedName GhcRn) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcRn -> m (IEWrappedName GhcRn) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcRn -> m (IEWrappedName GhcRn) #
Data (IEWrappedName GhcTc) # |
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) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (IEWrappedName GhcTc) # toConstr :: IEWrappedName GhcTc -> Constr # dataTypeOf :: IEWrappedName GhcTc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (IEWrappedName GhcTc)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (IEWrappedName GhcTc)) # gmapT :: (forall b. Data b => b -> b) -> IEWrappedName GhcTc -> IEWrappedName GhcTc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcTc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IEWrappedName GhcTc -> r # gmapQ :: (forall d. Data d => d -> u) -> IEWrappedName GhcTc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> IEWrappedName GhcTc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> IEWrappedName GhcTc -> m (IEWrappedName GhcTc) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcTc -> m (IEWrappedName GhcTc) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IEWrappedName GhcTc -> m (IEWrappedName GhcTc) #
(HasOccName (IdP (GhcPass p)), OutputableBndrId p) => HasOccName (IEWrappedName (GhcPass p)) # |
Instance details Methods occName :: IEWrappedName (GhcPass p) -> OccName #
OutputableBndrId p => Outputable (IE (GhcPass p)) # |
Instance details Methods ppr :: IE (GhcPass p) -> SDoc #
OutputableBndrId p => Outputable (IEWrappedName (GhcPass p)) # |
Instance details Methods ppr :: IEWrappedName (GhcPass p) -> SDoc #
(OutputableBndrId p, Outputable (Anno (IE (GhcPass p))), Outputable (ImportDeclPkgQual (GhcPass p))) => Outputable (ImportDecl (GhcPass p)) # |
Instance details Methods ppr :: ImportDecl (GhcPass p) -> SDoc #
OutputableBndrId p => OutputableBndr (IEWrappedName (GhcPass p)) # |
Instance details Methods pprBndr :: BindingSite -> IEWrappedName (GhcPass p) -> SDoc # pprPrefixOcc :: IEWrappedName (GhcPass p) -> SDoc # pprInfixOcc :: IEWrappedName (GhcPass p) -> SDoc # bndrIsJoin_maybe :: IEWrappedName (GhcPass p) -> JoinPointHood #
Eq (IEWrappedName GhcPs) # |
Instance details Methods (==) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool # (/=) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool #
Eq (IEWrappedName GhcRn) # |
Instance details Methods (==) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool # (/=) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool #
Eq (IEWrappedName GhcTc) # |
Instance details Methods (==) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool # (/=) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool #