doctest-parallel-0.2.3: Test interactive Haskell examples
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.DocTest.Internal.Interpreter

Synopsis

Documentation

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.

withInterpreter Source #

Arguments

:: [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"