Safe Haskell | None |
---|---|
Language | Haskell2010 |
- run :: Session a -> IO a
- initialize :: Session ()
- runWith :: Config -> Session a -> IO a
- initializeWith :: Config -> Session ()
- setStrFlags :: [String] -> Session ()
- setImports :: [Import] -> Session ()
- withImports :: [Import] -> Session a -> Session a
- setFlags :: [ExtensionFlag] -> Session ()
- unsetFlags :: [ExtensionFlag] -> Session ()
- withExtensionFlags :: [ExtensionFlag] -> [ExtensionFlag] -> Session a -> Session a
- runStmt :: String -> Session ()
- runDecls :: String -> Session ()
- runAssignment :: String -> String -> Session ()
- runAssignment' :: String -> String -> Session ()
- interpret :: Typeable a => String -> Session a
- sandboxDynFlags :: Session a -> Session a
- sandboxContext :: Session a -> Session a
- interceptErrors :: Ghc a -> Session a
Session
initialize :: Session () Source
Initialize session with default config.
initializeWith :: Config -> Session () Source
Initialize session with custom GHC config.
Flags
setStrFlags :: [String] -> Session () Source
Set ghc command line arguments.
Imports
setImports :: [Import] -> Session () Source
Set imports and replace existing ones.
withImports :: [Import] -> Session a -> Session a Source
Run a code with temporary imports.
GHC extensions
setFlags :: [ExtensionFlag] -> Session () Source
Set GHC extension flags.
unsetFlags :: [ExtensionFlag] -> Session () Source
Unset GHC extension flags.
withExtensionFlags :: [ExtensionFlag] -> [ExtensionFlag] -> Session a -> Session a Source
Run a code with temporary GHC extension flags.
Expression evaluation
runAssignment :: String -> String -> Session () Source
Bind expression do a variable using `let` syntax.
runAssignment' :: String -> String -> Session () Source
Bind expression to a variable using bind
syntax. Expression must have type `IO a`.
Context and DynFlags protection
sandboxDynFlags :: Session a -> Session a Source
Run a code which can safely modify DynFlags - it will be restored on exit.
sandboxContext :: Session a -> Session a Source
Run a code which can safely modify Context w- it will be restored on exit.
interceptErrors :: Ghc a -> Session a Source
Restore session when exception will be raised.