module GHC.Driver.Backpack.Syntax (
HsUnitId(..),
LHsUnitId,
HsModuleSubst,
LHsModuleSubst,
HsModuleId(..),
LHsModuleId,
HsComponentId(..),
LHsUnit, HsUnit(..),
LHsUnitDecl, HsUnitDecl(..),
IncludeDecl(..),
LRenaming, Renaming(..),
) where
import GHC.Prelude
import GHC.Hs
import GHC.Types.SrcLoc
import GHC.Types.SourceFile
import GHC.Unit.Module.Name
import GHC.Unit.Types
import GHC.Unit.Info
import GHC.Utils.Outputable
data HsComponentId = HsComponentId {
hsPackageName :: PackageName,
hsComponentId :: IndefUnitId
}
instance Outputable HsComponentId where
ppr (HsComponentId _pn cid) = ppr cid
data HsUnitId n = HsUnitId (Located n) [LHsModuleSubst n]
type LHsUnitId n = Located (HsUnitId n)
type HsModuleSubst n = (Located ModuleName, LHsModuleId n)
type LHsModuleSubst n = Located (HsModuleSubst n)
data HsModuleId n = HsModuleVar (Located ModuleName)
| HsModuleId (LHsUnitId n) (Located ModuleName)
type LHsModuleId n = Located (HsModuleId n)
data HsUnit n = HsUnit {
hsunitName :: Located n,
hsunitBody :: [LHsUnitDecl n]
}
type LHsUnit n = Located (HsUnit n)
data HsUnitDecl n
= DeclD HscSource (Located ModuleName) (Maybe (Located HsModule))
| IncludeD (IncludeDecl n)
type LHsUnitDecl n = Located (HsUnitDecl n)
data IncludeDecl n = IncludeDecl {
idUnitId :: LHsUnitId n,
idModRenaming :: Maybe [ LRenaming ],
idSignatureInclude :: Bool
}
data Renaming = Renaming { renameFrom :: Located ModuleName
, renameTo :: Maybe (Located ModuleName) }
type LRenaming = Located Renaming