plugins-1.5.2.3: Dynamic linking for Haskell and C objects

Safe HaskellSafe-Infered

System.Plugins.Env

Synopsis

Documentation

env :: (MVar (), IORef (FiniteMap key elt), IORef (FiniteMap key1 elt1), IORef PkgEnvs, IORef (Set [Char]), IORef (FiniteMap key2 elt2))Source

withModEnv :: Env -> (ModEnv -> IO a) -> IO aSource

apply f to the loaded objects Env, apply f to the package.conf FM locks up the MVar so you can't recursively call a function inside a with any -Env function. Nice and threadsafe

withDepEnv :: Env -> (DepEnv -> IO a) -> IO aSource

withPkgEnvs :: Env -> (PkgEnvs -> IO a) -> IO aSource

withMerged :: Env -> (MergeEnv -> IO a) -> IO aSource

modifyModEnv :: Env -> (ModEnv -> IO ModEnv) -> IO ()Source

modifyDepEnv :: Env -> (DepEnv -> IO DepEnv) -> IO ()Source

modifyPkgEnv :: Env -> (PkgEnvs -> IO PkgEnvs) -> IO ()Source

modifyMerged :: Env -> (MergeEnv -> IO MergeEnv) -> IO ()Source

addModule :: String -> Module -> IO ()Source

insert a loaded module name into the environment

rmModule :: String -> IO BoolSource

remove a module name from the environment. Returns True if the module was actually removed.

addModules :: [(String, Module)] -> IO ()Source

insert a list of module names all in one go

isLoaded :: String -> IO BoolSource

is a module/package already loaded?

addModuleDeps :: Module -> [Module] -> IO ()Source

Set the dependencies of a Module.

getModuleDeps :: Module -> IO [Module]Source

Get module dependencies. Nothing if none have been recored.

rmModuleDeps :: Module -> IO ()Source

Unrecord a module from the environment.

addPkgConf :: FilePath -> IO ()Source

Insert a single package.conf (containing multiple configs) means: create a new FM. insert packages into FM. add FM to end of list of FM stored in the environment.

union :: PkgEnvs -> [PackageConfig] -> PkgEnvsSource

add a new FM for the package.conf to the list of existing ones; if a package occurs multiple times, pick the one with the higher version number as the default (e.g., important for base in GHC 6.12)

addStaticPkg :: PackageName -> IO ()Source

isStaticPkg :: PackageName -> IO BoolSource

grabDefaultPkgConf :: IO PkgEnvsSource

generate a PkgEnv from the system package.conf The path to the default package.conf was determined by configure This imposes a constraint that you must build your plugins with the same ghc you use to build hs-plugins. This is reasonable, we feel.

readPackageConf :: FilePath -> IO [PackageConfig]Source

lookupPkg :: PackageName -> IO ([FilePath], [FilePath])Source