ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Hs.ImpExp

Contents

- Orphan instances

Synopsis

- module Language.Haskell.Syntax.ImpExp
- data XImportDeclPass = XImportDeclPass {
  - ideclAnn :: EpAnn EpAnnImportDecl
  - ideclSourceText :: SourceText
  - ideclImplicit :: Bool
  }
- data EpAnnImportDecl = EpAnnImportDecl {
  - importDeclAnnImport :: EpaLocation
  - importDeclAnnPragma :: Maybe (EpaLocation, EpaLocation)
  - importDeclAnnSafe :: Maybe EpaLocation
  - importDeclAnnQualified :: Maybe EpaLocation
  - importDeclAnnPackage :: Maybe EpaLocation
  - importDeclAnnAs :: Maybe EpaLocation
  }
- importDeclQualifiedStyle :: Maybe EpaLocation -> Maybe EpaLocation -> (Maybe EpaLocation, ImportDeclQualifiedStyle)
- isImportDeclQualified :: ImportDeclQualifiedStyle -> Bool
- simpleImportDecl :: ModuleName -> ImportDecl GhcPs
- ieName :: IE (GhcPass p) -> IdP (GhcPass p)
- ieWrappedName :: IEWrappedName (GhcPass p) -> IdP (GhcPass p)
- ieNames :: IE (GhcPass p) -> [IdP (GhcPass p)]
- ieWrappedLName :: IEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- lieWrappedName :: LIEWrappedName (GhcPass p) -> IdP (GhcPass p)
- ieLWrappedName :: LIEWrappedName (GhcPass p) -> LIdP (GhcPass p)
- replaceWrappedName :: IEWrappedName GhcPs -> IdP GhcRn -> IEWrappedName GhcRn
- replaceLWrappedName :: LIEWrappedName GhcPs -> IdP GhcRn -> LIEWrappedName GhcRn
- pprImpExp :: (HasOccName name, OutputableBndr name) => name -> SDoc

# Documentation

module Language.Haskell.Syntax.ImpExp

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 :: EpaLocation
- importDeclAnnPragma :: Maybe (EpaLocation, EpaLocation)
- importDeclAnnSafe :: Maybe EpaLocation
- importDeclAnnQualified :: Maybe EpaLocation
- importDeclAnnPackage :: Maybe EpaLocation
- importDeclAnnAs :: Maybe EpaLocation

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

importDeclQualifiedStyle :: Maybe EpaLocation -> Maybe EpaLocation -> (Maybe EpaLocation, 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.

simpleImportDecl :: ModuleName -> ImportDecl GhcPs Source #

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

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

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

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

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

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

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

replaceLWrappedName :: LIEWrappedName GhcPs -> IdP GhcRn -> LIEWrappedName GhcRn 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) -> Maybe Int Source #
Eq (IEWrappedName GhcPs) Source # |
Instance details Methods (==) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool # (/=) :: IEWrappedName GhcPs -> IEWrappedName GhcPs -> Bool #
Eq (IEWrappedName GhcRn) Source # |
Instance details Methods (==) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool # (/=) :: IEWrappedName GhcRn -> IEWrappedName GhcRn -> Bool #
Eq (IEWrappedName GhcTc) Source # |
Instance details Methods (==) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool # (/=) :: IEWrappedName GhcTc -> IEWrappedName GhcTc -> Bool #