GHC.Hs.ImpExp

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Hs.ImpExp

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax.ImpExp
- exportDocstring :: LHsDoc pass -> SDoc
- ieDeprecation :: forall (p :: Pass). IsPass p => IE (GhcPass p) -> Maybe (WarningTxt (GhcPass p))
- ieLIEWrappedName :: forall (p :: Pass). IE (GhcPass p) -> LIEWrappedName (GhcPass p)
- ieLWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- ieName :: forall (p :: Pass). IE (GhcPass p) -> IdP (GhcPass p)
- ieNames :: forall (p :: Pass). IE (GhcPass p) -> [IdP (GhcPass p)]
- ieWrappedLName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- ieWrappedName :: forall (p :: Pass). IEWrappedName (GhcPass p) -> IdP (GhcPass p)
- isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
- lieWrappedName :: forall (p :: Pass). LIEWrappedName (GhcPass p) -> IdP (GhcPass p)
- pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc
- replaceLWrappedName :: LIEWrappedName GhcPs -> IdP GhcRn -> LIEWrappedName GhcRn
- replaceWrappedName :: IEWrappedName GhcPs -> IdP GhcRn -> IEWrappedName GhcRn
- simpleImportDecl :: ModuleName -> ImportDecl GhcPs
- 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")
- type IEThingWithAnns = (EpToken "(", EpToken "..", EpToken ",", EpToken ")")
- data XImportDeclPass = XImportDeclPass {
  - ideclAnn :: EpAnn EpAnnImportDecl
  - ideclSourceText :: SourceText
  - ideclImplicit :: Bool
  }

# Documentation

module Language.Haskell.Syntax.ImpExp

exportDocstring :: LHsDoc pass -> SDoc Source #

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

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

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

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

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

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

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

isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool Source #

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

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

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

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

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

simpleImportDecl :: ModuleName -> ImportDecl GhcPs 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 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

NoAnn EpAnnImportDecl Source # |
Instance details Defined in GHC.Hs.ImpExp Methods noAnn :: EpAnnImportDecl Source #
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 #

data EpAnnLevel Source #

Constructors

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

#### Instances

Instances details

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

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

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 #

# Orphan instances

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