Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Interpreter
- safeEval :: Interpreter -> String -> IO (Either String String)
- safeEvalIt :: Interpreter -> String -> IO (Either String String)
- withInterpreter :: [String] -> (Interpreter -> IO a) -> IO a
- ghc :: FilePath
- interpreterSupported :: IO Bool
- ghcInfo :: IO [(String, String)]
- haveInterpreterKey :: String
Documentation
data Interpreter Source #
safeEval :: Interpreter -> String -> IO (Either String String) Source #
Evaluate an expression; return a Left value on exceptions.
An exception may e.g. be caused on unterminated multiline expressions.
safeEvalIt :: Interpreter -> String -> IO (Either String String) Source #
:: [String] | List of flags, passed to GHC |
-> (Interpreter -> IO a) | Action to run |
-> IO a | Result of action |
Run an interpreter session.
Example:
>>>
withInterpreter [] $ \i -> eval i "23 + 42"
"65\n"