mueval-0.6: Safely evaluate Haskell expressionsSource codeContentsIndex
Mueval.Interpreter
Synopsis
say :: String -> Interpreter ()
printInterpreterError :: InterpreterError -> IO ()
interpreter :: Bool -> Bool -> [ModuleName] -> String -> String -> Interpreter ()
interpreterSession :: Bool -> Bool -> [ModuleName] -> String -> String -> IO ()
mvload :: FilePath -> IO ()
Documentation
say :: String -> Interpreter ()Source
From inside the Interpreter monad, print the String (presumably the result of interpreting something), but only print the first 1024 characters to avoid flooding. Lambdabot has a similar limit.
printInterpreterError :: InterpreterError -> IO ()Source
Oh no, something has gone wrong. Call error and then, as with say, print out a maximum of 1024 characters.
interpreter :: Bool -> Bool -> [ModuleName] -> String -> String -> Interpreter ()Source
The actual calling of Hint functionality. The heart of this just calls eval, but we do so much more - we disable Haskell extensions, turn on optimizations, hide all packages, make sure one cannot call unimported functions, typecheck (and optionally print it), set resource limits for this thread, and do some error handling.
interpreterSessionSource
:: BoolWhether to print inferred type
-> BoolWhether to use GHC extensions
-> [ModuleName]A list of modules we wish to be visible
-> StringA local file from which to grab definitions; an empty string is treated as no file.
-> StringThe string to be interpreted as a Haskell expression
-> IO ()No real result, since printing is done deeper in the stack.
Wrapper around interpreter; supplies a fresh GHC API session and error-handling. The arguments are simply passed on.
mvload :: FilePath -> IO ()Source
Produced by Haddock version 2.3.0