| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Haskell.Interpreter
Synopsis
- runghc :: (Show t, TimeUnit t, MonadIO m, MonadError InterpreterError m, MonadMask m) => t -> [String] -> FilePath -> m (InterpreterResult String)
- data CompilationError
- data InterpreterError
- newtype SourceCode = SourceCode Text
- avoidUnsafe :: MonadError InterpreterError m => SourceCode -> m ()
- newtype Warning = Warning Text
- data InterpreterResult a = InterpreterResult {}
- parseErrorText :: Text -> CompilationError
Documentation
runghc :: (Show t, TimeUnit t, MonadIO m, MonadError InterpreterError m, MonadMask m) => t -> [String] -> FilePath -> m (InterpreterResult String) Source #
spawn an external process to runghc a file
If you set the environmental varaiable GHC_BIN_DIR then the executable runghc in that path will be used. This is useful if you want to your file to be run with some packages available, you can create a wrapper runghc that includes these
Any errors are converted to InterpreterError
data CompilationError Source #
Constructors
| RawError Text | |
| CompilationError | |
Instances
data InterpreterError Source #
Constructors
| CompilationErrors [CompilationError] | |
| TimeoutError Text |
Instances
newtype SourceCode Source #
Constructors
| SourceCode Text |
Instances
avoidUnsafe :: MonadError InterpreterError m => SourceCode -> m () Source #
data InterpreterResult a Source #
Constructors
| InterpreterResult | |