Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UnitEnv = UnitEnv {}
- initUnitEnv :: UnitId -> HomeUnitGraph -> GhcNameVersion -> Platform -> IO UnitEnv
- unsafeGetHomeUnit :: UnitEnv -> HomeUnit
- updateHug :: (HomeUnitGraph -> HomeUnitGraph) -> UnitEnv -> UnitEnv
- updateHpt :: (HomePackageTable -> HomePackageTable) -> UnitEnv -> UnitEnv
- ue_units :: HasDebugCallStack => UnitEnv -> UnitState
- ue_currentHomeUnitEnv :: HasDebugCallStack => UnitEnv -> HomeUnitEnv
- ue_setUnits :: UnitState -> UnitEnv -> UnitEnv
- ue_setUnitFlags :: HasDebugCallStack => UnitId -> DynFlags -> UnitEnv -> UnitEnv
- ue_unit_dbs :: UnitEnv -> Maybe [UnitDatabase UnitId]
- ue_setUnitDbs :: Maybe [UnitDatabase UnitId] -> UnitEnv -> UnitEnv
- ue_hpt :: HasDebugCallStack => UnitEnv -> HomePackageTable
- ue_homeUnit :: UnitEnv -> Maybe HomeUnit
- ue_unsafeHomeUnit :: UnitEnv -> HomeUnit
- ue_setFlags :: HasDebugCallStack => DynFlags -> UnitEnv -> UnitEnv
- ue_setActiveUnit :: UnitId -> UnitEnv -> UnitEnv
- ue_currentUnit :: UnitEnv -> UnitId
- ue_findHomeUnitEnv :: HasDebugCallStack => UnitId -> UnitEnv -> HomeUnitEnv
- ue_updateHomeUnitEnv :: (HomeUnitEnv -> HomeUnitEnv) -> UnitId -> UnitEnv -> UnitEnv
- ue_unitHomeUnit :: UnitId -> UnitEnv -> HomeUnit
- ue_unitFlags :: HasDebugCallStack => UnitId -> UnitEnv -> DynFlags
- ue_renameUnitId :: HasDebugCallStack => UnitId -> UnitId -> UnitEnv -> UnitEnv
- ue_transitiveHomeDeps :: UnitId -> UnitEnv -> [UnitId]
- type HomeUnitGraph = UnitEnvGraph HomeUnitEnv
- data HomeUnitEnv = HomeUnitEnv {}
- mkHomeUnitEnv :: DynFlags -> HomePackageTable -> Maybe HomeUnit -> HomeUnitEnv
- lookupHugByModule :: Module -> HomeUnitGraph -> Maybe HomeModInfo
- hugElts :: HomeUnitGraph -> [(UnitId, HomeUnitEnv)]
- lookupHug :: HomeUnitGraph -> UnitId -> ModuleName -> Maybe HomeModInfo
- addHomeModInfoToHug :: HomeModInfo -> HomeUnitGraph -> HomeUnitGraph
- newtype UnitEnvGraph v = UnitEnvGraph {
- unitEnv_graph :: Map UnitEnvGraphKey v
- unitEnv_insert :: UnitEnvGraphKey -> v -> UnitEnvGraph v -> UnitEnvGraph v
- unitEnv_delete :: UnitEnvGraphKey -> UnitEnvGraph v -> UnitEnvGraph v
- unitEnv_adjust :: (v -> v) -> UnitEnvGraphKey -> UnitEnvGraph v -> UnitEnvGraph v
- unitEnv_new :: Map UnitEnvGraphKey v -> UnitEnvGraph v
- unitEnv_singleton :: UnitEnvGraphKey -> v -> UnitEnvGraph v
- unitEnv_map :: (v -> v) -> UnitEnvGraph v -> UnitEnvGraph v
- unitEnv_member :: UnitEnvGraphKey -> UnitEnvGraph v -> Bool
- unitEnv_lookup_maybe :: UnitEnvGraphKey -> UnitEnvGraph v -> Maybe v
- unitEnv_lookup :: UnitEnvGraphKey -> UnitEnvGraph v -> v
- unitEnv_keys :: UnitEnvGraph v -> Set UnitEnvGraphKey
- unitEnv_elts :: UnitEnvGraph v -> [(UnitEnvGraphKey, v)]
- unitEnv_hpts :: UnitEnvGraph HomeUnitEnv -> [HomePackageTable]
- unitEnv_foldWithKey :: (b -> UnitEnvGraphKey -> a -> b) -> b -> UnitEnvGraph a -> b
- unitEnv_mapWithKey :: (UnitEnvGraphKey -> v -> b) -> UnitEnvGraph v -> UnitEnvGraph b
- assertUnitEnvInvariant :: HasDebugCallStack => UnitEnv -> UnitEnv
- preloadUnitsInfo :: UnitEnv -> MaybeErr UnitErr [UnitInfo]
- preloadUnitsInfo' :: UnitEnv -> [UnitId] -> MaybeErr UnitErr [UnitInfo]
- isUnitEnvInstalledModule :: UnitEnv -> InstalledModule -> Bool
Documentation
UnitEnv | |
|
initUnitEnv :: UnitId -> HomeUnitGraph -> GhcNameVersion -> Platform -> IO UnitEnv Source #
unsafeGetHomeUnit :: UnitEnv -> HomeUnit Source #
Get home-unit
Unsafe because the home-unit may not be set
updateHug :: (HomeUnitGraph -> HomeUnitGraph) -> UnitEnv -> UnitEnv Source #
updateHpt :: (HomePackageTable -> HomePackageTable) -> UnitEnv -> UnitEnv Source #
Unit Env helper functions
ue_setUnitFlags :: HasDebugCallStack => UnitId -> DynFlags -> UnitEnv -> UnitEnv Source #
ue_unit_dbs :: UnitEnv -> Maybe [UnitDatabase UnitId] Source #
ue_setUnitDbs :: Maybe [UnitDatabase UnitId] -> UnitEnv -> UnitEnv Source #
ue_hpt :: HasDebugCallStack => UnitEnv -> HomePackageTable Source #
ue_unsafeHomeUnit :: UnitEnv -> HomeUnit Source #
ue_setFlags :: HasDebugCallStack => DynFlags -> UnitEnv -> UnitEnv Source #
ue_currentUnit :: UnitEnv -> UnitId Source #
ue_findHomeUnitEnv :: HasDebugCallStack => UnitId -> UnitEnv -> HomeUnitEnv Source #
ue_updateHomeUnitEnv :: (HomeUnitEnv -> HomeUnitEnv) -> UnitId -> UnitEnv -> UnitEnv Source #
ue_unitFlags :: HasDebugCallStack => UnitId -> UnitEnv -> DynFlags Source #
ue_renameUnitId :: HasDebugCallStack => UnitId -> UnitId -> UnitEnv -> UnitEnv Source #
Rename a unit id in the internal unit env.
, it is assumed that the ue_renameUnitId
oldUnit newUnit UnitEnvoldUnit
exists in the map,
otherwise we panic.
The DynFlags
associated with the home unit will have its field homeUnitId
set to newUnit
.
HomeUnitEnv
type HomeUnitGraph = UnitEnvGraph HomeUnitEnv Source #
data HomeUnitEnv Source #
HomeUnitEnv | |
|
Instances
Outputable HomeUnitEnv Source # | |
Defined in GHC.Unit.Env ppr :: HomeUnitEnv -> SDoc Source # | |
Outputable (UnitEnvGraph HomeUnitEnv) Source # | |
Defined in GHC.Unit.Env ppr :: UnitEnvGraph HomeUnitEnv -> SDoc Source # |
mkHomeUnitEnv :: DynFlags -> HomePackageTable -> Maybe HomeUnit -> HomeUnitEnv Source #
lookupHugByModule :: Module -> HomeUnitGraph -> Maybe HomeModInfo Source #
hugElts :: HomeUnitGraph -> [(UnitId, HomeUnitEnv)] Source #
lookupHug :: HomeUnitGraph -> UnitId -> ModuleName -> Maybe HomeModInfo Source #
UnitEnvGraph
newtype UnitEnvGraph v Source #
UnitEnvGraph | |
|
Instances
unitEnv_insert :: UnitEnvGraphKey -> v -> UnitEnvGraph v -> UnitEnvGraph v Source #
unitEnv_delete :: UnitEnvGraphKey -> UnitEnvGraph v -> UnitEnvGraph v Source #
unitEnv_adjust :: (v -> v) -> UnitEnvGraphKey -> UnitEnvGraph v -> UnitEnvGraph v Source #
unitEnv_new :: Map UnitEnvGraphKey v -> UnitEnvGraph v Source #
unitEnv_singleton :: UnitEnvGraphKey -> v -> UnitEnvGraph v Source #
unitEnv_map :: (v -> v) -> UnitEnvGraph v -> UnitEnvGraph v Source #
unitEnv_member :: UnitEnvGraphKey -> UnitEnvGraph v -> Bool Source #
unitEnv_lookup_maybe :: UnitEnvGraphKey -> UnitEnvGraph v -> Maybe v Source #
unitEnv_lookup :: UnitEnvGraphKey -> UnitEnvGraph v -> v Source #
unitEnv_keys :: UnitEnvGraph v -> Set UnitEnvGraphKey Source #
unitEnv_elts :: UnitEnvGraph v -> [(UnitEnvGraphKey, v)] Source #
unitEnv_foldWithKey :: (b -> UnitEnvGraphKey -> a -> b) -> b -> UnitEnvGraph a -> b Source #
unitEnv_mapWithKey :: (UnitEnvGraphKey -> v -> b) -> UnitEnvGraph v -> UnitEnvGraph b Source #
Invariants
Preload units info
preloadUnitsInfo :: UnitEnv -> MaybeErr UnitErr [UnitInfo] Source #
Lookup UnitInfo
for every preload unit from the UnitState and for every
unit used to instantiate the home unit.
preloadUnitsInfo' :: UnitEnv -> [UnitId] -> MaybeErr UnitErr [UnitInfo] Source #
Lookup UnitInfo
for every preload unit from the UnitState, for every unit
used to instantiate the home unit, and for every unit explicitly passed in
the given list of UnitId.
Home Module functions
isUnitEnvInstalledModule :: UnitEnv -> InstalledModule -> Bool Source #
Test if the module comes from the home unit