ghcide-2.4.0.0: The core of an IDE

Safe Haskell | Safe-Inferred
Language | Haskell2010

Development.IDE.GHC.Compat.Units

Contents

- UnitState
- UnitInfoMap
- UnitInfo
- UnitId helpers
- Module
- ExternalPackageState
- Utils

Description

Compat module for `UnitState` and `UnitInfo`.

Synopsis

- data UnitState
- initUnits :: [DynFlags] -> HscEnv -> IO HscEnv
- oldInitUnits :: DynFlags -> IO DynFlags
- unitState :: HscEnv -> UnitState
- getUnitName :: HscEnv -> UnitId -> Maybe PackageName
- explicitUnits :: UnitState -> [Unit]
- preloadClosureUs :: HscEnv -> PreloadUnitClosure
- listVisibleModuleNames :: HscEnv -> [ModuleName]
- data LookupResult
  - = LookupFound Module (UnitInfo, ModuleOrigin)
  - | LookupMultiple [(Module, ModuleOrigin)]
  - | LookupHidden [(Module, ModuleOrigin)] [(Module, ModuleOrigin)]
  - | LookupUnusable [(Module, ModuleOrigin)]
  - | LookupNotFound [ModuleSuggestion]
- lookupModuleWithSuggestions :: HscEnv -> ModuleName -> PkgQual -> LookupResult
- type UnitInfoMap = UnitInfoMap
- getUnitInfoMap :: HscEnv -> UnitInfoMap
- lookupUnit :: HscEnv -> Unit -> Maybe UnitInfo
- lookupUnit' :: Bool -> UnitInfoMap -> PreloadUnitClosure -> Unit -> Maybe UnitInfo
- type UnitInfo = GenUnitInfo UnitId
- unitExposedModules :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> [(modulename, Maybe mod)]
- unitDepends :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> [uid]
- unitHaddockInterfaces :: UnitInfo -> [FilePath]
- mkUnit :: UnitInfo -> Unit
- unitPackageNameString :: GenUnitInfo u -> String
- unitPackageVersion :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> Version
- data UnitId
- type Unit = GenUnit UnitId
- unitString :: IsUnitId u => u -> String
- stringToUnit :: String -> Unit
- definiteUnitId :: Definite uid -> GenUnit uid
- defUnitId :: unit -> Definite unit
- installedModule :: unit -> ModuleName -> GenModule unit
- toUnitId :: Unit -> UnitId
- moduleUnitId :: Module -> UnitId
- moduleUnit :: GenModule unit -> unit
- data ExternalPackageState = EPS {
  - eps_is_boot :: !(InstalledModuleEnv ModuleNameWithIsBoot)
  - eps_PIT :: !PackageIfaceTable
  - eps_free_holes :: InstalledModuleEnv (UniqDSet ModuleName)
  - eps_PTE :: !PackageTypeEnv
  - eps_inst_env :: !PackageInstEnv
  - eps_fam_inst_env :: !PackageFamInstEnv
  - eps_rule_base :: !PackageRuleBase
  - eps_ann_env :: !PackageAnnEnv
  - eps_complete_matches :: !PackageCompleteMatches
  - eps_mod_fam_inst_env :: !(ModuleEnv FamInstEnv)
  - eps_stats :: !EpsStats
  }
- filterInplaceUnits :: [UnitId] -> [PackageFlag] -> ([UnitId], [PackageFlag])
- data FinderCache
- showSDocForUser' :: HscEnv -> PrintUnqualified -> SDoc -> String
- findImportedModule :: HscEnv -> ModuleName -> IO (Maybe Module)

# UnitState

data UnitState #

initUnits :: [DynFlags] -> HscEnv -> IO HscEnv #

oldInitUnits :: DynFlags -> IO DynFlags #

oldInitUnits only needs to modify DynFlags for GHC <9.2 For GHC >= 9.2, we need to set the hsc_unit_env also, that is done later by initUnits

unitState :: HscEnv -> UnitState #

getUnitName :: HscEnv -> UnitId -> Maybe PackageName #

explicitUnits :: UnitState -> [Unit] #

preloadClosureUs :: HscEnv -> PreloadUnitClosure #

listVisibleModuleNames :: HscEnv -> [ModuleName] #

data LookupResult #

Constructors

LookupFound Module (UnitInfo, ModuleOrigin) |
LookupMultiple [(Module, ModuleOrigin)] |
LookupHidden [(Module, ModuleOrigin)] [(Module, ModuleOrigin)] |
LookupUnusable [(Module, ModuleOrigin)] |
LookupNotFound [ModuleSuggestion] |

lookupModuleWithSuggestions :: HscEnv -> ModuleName -> PkgQual -> LookupResult #

# UnitInfoMap

type UnitInfoMap = UnitInfoMap #

getUnitInfoMap :: HscEnv -> UnitInfoMap #

lookupUnit :: HscEnv -> Unit -> Maybe UnitInfo #

lookupUnit' :: Bool -> UnitInfoMap -> PreloadUnitClosure -> Unit -> Maybe UnitInfo #

# UnitInfo

type UnitInfo = GenUnitInfo UnitId #

unitExposedModules :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> [(modulename, Maybe mod)] #

unitDepends :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> [uid] #

unitHaddockInterfaces :: UnitInfo -> [FilePath] #

mkUnit :: UnitInfo -> Unit #

unitPackageNameString :: GenUnitInfo u -> String #

unitPackageVersion :: GenericUnitInfo srcpkgid srcpkgname uid modulename mod -> Version #

# UnitId helpers

data UnitId #

#### Instances

Instances details

Data Unit |
Instance details Defined in GHC.Unit.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Unit -> c Unit gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Unit toConstr :: Unit -> Constr dataTypeOf :: Unit -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Unit) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Unit) gmapT :: (forall b. Data b => b -> b) -> Unit -> Unit gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Unit -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Unit -> r gmapQ :: (forall d. Data d => d -> u) -> Unit -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> Unit -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> Unit -> m Unit gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Unit -> m Unit gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Unit -> m Unit
Data UnitId |
Instance details Defined in GHC.Unit.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnitId -> c UnitId gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnitId toConstr :: UnitId -> Constr dataTypeOf :: UnitId -> DataType dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnitId) dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnitId) gmapT :: (forall b. Data b => b -> b) -> UnitId -> UnitId gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnitId -> r gmapQ :: (forall d. Data d => d -> u) -> UnitId -> [u] gmapQi :: Int -> (forall d. Data d => d -> u) -> UnitId -> u gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnitId -> m UnitId
Show Module # |
Instance details Defined in Development.IDE.GHC.Orphans Methods showsPrec :: Int -> Module -> ShowS # show :: Module -> String # showList :: [Module] -> ShowS #
Show Unit |
Instance details Defined in GHC.Unit.Types Methods showsPrec :: Int -> Unit -> ShowS # show :: Unit -> String # showList :: [Unit] -> ShowS #
Show UnitId # |
Instance details Defined in Development.IDE.GHC.Orphans Methods showsPrec :: Int -> UnitId -> ShowS # show :: UnitId -> String # showList :: [UnitId] -> ShowS #
NFData Unit |
Instance details Defined in GHC.Unit.Types Methods rnf :: Unit -> () #
NFData UnitId # |
Instance details Defined in Development.IDE.GHC.Orphans Methods rnf :: UnitId -> () #
Uniquable Module |
Instance details Defined in GHC.Unit.Types Methods getUnique :: Module -> Unique #
Uniquable UnitId |
Instance details Defined in GHC.Unit.Types Methods getUnique :: UnitId -> Unique #
IsUnitId UnitId |
Instance details Defined in GHC.Unit.Types Methods unitFS :: UnitId -> FastString #
Binary InstantiatedUnit |
Instance details Defined in GHC.Unit.Types Methods put_ :: BinHandle -> InstantiatedUnit -> IO () put :: BinHandle -> InstantiatedUnit -> IO (Bin InstantiatedUnit) get :: BinHandle -> IO InstantiatedUnit
Binary Unit |
Instance details Defined in GHC.Unit.Types Methods put_ :: BinHandle -> Unit -> IO () put :: BinHandle -> Unit -> IO (Bin Unit) get :: BinHandle -> IO Unit
Binary UnitId |
Instance details Defined in GHC.Unit.Types Methods put_ :: BinHandle -> UnitId -> IO () put :: BinHandle -> UnitId -> IO (Bin UnitId) get :: BinHandle -> IO UnitId
Outputable InstalledModule |
Instance details Defined in GHC.Unit.Types Methods ppr :: InstalledModule -> SDoc #
Outputable InstantiatedModule |
Instance details Defined in GHC.Unit.Types Methods ppr :: InstantiatedModule -> SDoc #
Outputable InstantiatedUnit |
Instance details Defined in GHC.Unit.Types Methods ppr :: InstantiatedUnit -> SDoc #
Outputable Module |
Instance details Defined in GHC.Unit.Types Methods ppr :: Module -> SDoc #
Outputable Unit |
Instance details Defined in GHC.Unit.Types Methods ppr :: Unit -> SDoc #
Outputable UnitId |
Instance details Defined in GHC.Unit.Types Methods ppr :: UnitId -> SDoc #
Eq UnitId |
Instance details Defined in GHC.Unit.Types Methods (==) :: UnitId -> UnitId -> Bool # (/=) :: UnitId -> UnitId -> Bool #
Ord Unit |
Instance details Defined in GHC.Unit.Types Methods compare :: Unit -> Unit -> Ordering (<) :: Unit -> Unit -> Bool (<=) :: Unit -> Unit -> Bool (>) :: Unit -> Unit -> Bool (>=) :: Unit -> Unit -> Bool max :: Unit -> Unit -> Unit min :: Unit -> Unit -> Unit
Ord UnitId |
Instance details Defined in GHC.Unit.Types Methods compare :: UnitId -> UnitId -> Ordering (<) :: UnitId -> UnitId -> Bool (<=) :: UnitId -> UnitId -> Bool (>) :: UnitId -> UnitId -> Bool (>=) :: UnitId -> UnitId -> Bool max :: UnitId -> UnitId -> UnitId min :: UnitId -> UnitId -> UnitId

type Unit = GenUnit UnitId #

unitString :: IsUnitId u => u -> String #

stringToUnit :: String -> Unit #

definiteUnitId :: Definite uid -> GenUnit uid #

defUnitId :: unit -> Definite unit #

installedModule :: unit -> ModuleName -> GenModule unit #

# Module

toUnitId :: Unit -> UnitId #

moduleUnitId :: Module -> UnitId #

moduleUnit :: GenModule unit -> unit #

# ExternalPackageState

data ExternalPackageState #

Constructors

EPS |
Fields eps_is_boot :: !(InstalledModuleEnv ModuleNameWithIsBoot) eps_PIT :: !PackageIfaceTable eps_free_holes :: InstalledModuleEnv (UniqDSet ModuleName) eps_PTE :: !PackageTypeEnv eps_inst_env :: !PackageInstEnv eps_fam_inst_env :: !PackageFamInstEnv eps_rule_base :: !PackageRuleBase eps_ann_env :: !PackageAnnEnv eps_complete_matches :: !PackageCompleteMatches eps_mod_fam_inst_env :: !(ModuleEnv FamInstEnv) eps_stats :: !EpsStats

# Utils

filterInplaceUnits :: [UnitId] -> [PackageFlag] -> ([UnitId], [PackageFlag]) #

data FinderCache #

showSDocForUser' :: HscEnv -> PrintUnqualified -> SDoc -> String #

findImportedModule :: HscEnv -> ModuleName -> IO (Maybe Module) #