Safe Haskell | None |
---|---|
Language | Haskell98 |
- readExt :: String -> Extension
- interpreter :: Options -> Interpreter (String, String, String)
- interpreterSession :: Options -> IO ()
- cpload :: FilePath -> IO FilePath
- sayIO :: String -> IO ()
- printInterpreterError :: InterpreterError -> IO ()
- exceptionMsg :: String
- render :: (MonadIO m, Functor m) => Int -> String -> m (String, Bool)
- data Stream
- toStream :: String -> IO Stream
Documentation
interpreter :: Options -> Interpreter (String, String, String) Source
The actual calling of Hint functionality. The heart of this just calls
eval
, but we do so much more - we disable Haskell extensions,
hide all packages, make sure one cannot call unimported
functions, typecheck, set resource limits for this
thread, and do some error handling.
interpreterSession :: Options -> IO () Source
Wrapper around interpreter
; supplies a fresh GHC API session and
error-handling. The arguments are largely passed on, and the results lightly parsed.
cpload :: FilePath -> IO FilePath Source
Given a filepath (containing function definitions), copy it to a temporary file and change directory to it, returning the new filepath.
sayIO :: String -> IO () Source
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. If it's a compilation error pretty print the first 1024 chars of it and throw an ExitException otherwise rethrow the exception in String form.