plugins-1.5.7: Dynamic linking for Haskell and C objects

Safe HaskellNone
LanguageHaskell98

System.Plugins.Env

Synopsis

Documentation

env :: (MVar (), IORef (FiniteMap key1 elt1), IORef (FiniteMap key2 elt2), IORef PkgEnvs, IORef (Set [Char]), IORef (FiniteMap key3 elt3)) Source #

withModEnv :: Env -> (ModEnv -> IO a) -> IO a Source #

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

withPkgEnvs :: Env -> (PkgEnvs -> IO a) -> IO a Source #

withMerged :: Env -> (MergeEnv -> IO a) -> IO a Source #

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

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

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] -> PkgEnvs Source #

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

grabDefaultPkgConf :: IO PkgEnvs Source #

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 #