Safe Haskell | None |
---|
System.Plugins.Safe
- data Extension
- type Arg = String
- type Symbol = String
- data LoadStatus a
- = LoadSuccess Module a
- | LoadFailure Errors
- loadOneValue :: [Arg] -> [FilePath] -> FilePath -> [Extension] -> [String] -> [String] -> Symbol -> IO (LoadStatus a)
Documentation
data Extension
data LoadStatus a
The LoadStatus
type encodes the return status of functions that
perform dynamic loading in a type isomorphic to Either
. Failure
returns a list of error strings, success returns a reference to a
loaded module, and the Haskell value corresponding to the symbol that
was indexed.
Constructors
LoadSuccess Module a | |
LoadFailure Errors |
Arguments
:: [Arg] | Any command-line arguments for compiler |
-> [FilePath] | Include paths |
-> FilePath | Source file name |
-> [Extension] | Language extensions to enable |
-> [String] | Force this modules to be imported by plugin |
-> [String] | Allow to import this modules |
-> Symbol | Symbol to load |
-> IO (LoadStatus a) |
Load one specified symbol from Haskell source file. That source will be:
- Forced to use specified language extensions;
- Forced to import specified modules;
- Allowed to import specified set of modules;
- Forbidden to import any other modules;
- Forbidden to use any FFI declarations.
Unsafe declarations will be simply removed from module.
WARNING: source file name should start with capital letter.