playground-common-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Interpreter

Synopsis

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 

Fields

Instances

Instances details
Eq CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Show CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Generic CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type Rep CompilationError :: Type -> Type Source #

ToJSON CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

FromJSON CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep CompilationError Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep CompilationError = D1 ('MetaData "CompilationError" "Language.Haskell.Interpreter" "playground-common-0.1.0.0-LHGPmcl6mK723R6a6rRgpE" 'False) (C1 ('MetaCons "RawError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "CompilationError" 'PrefixI 'True) ((S1 ('MetaSel ('Just "filename") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "row") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "column") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text]))))

data InterpreterError Source #

Instances

Instances details
Eq InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Show InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Generic InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type Rep InterpreterError :: Type -> Type Source #

ToJSON InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

FromJSON InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep InterpreterError Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep InterpreterError = D1 ('MetaData "InterpreterError" "Language.Haskell.Interpreter" "playground-common-0.1.0.0-LHGPmcl6mK723R6a6rRgpE" 'False) (C1 ('MetaCons "CompilationErrors" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [CompilationError])) :+: C1 ('MetaCons "TimeoutError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

newtype SourceCode Source #

Constructors

SourceCode Text 

Instances

Instances details
Eq SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

Show SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

Generic SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type Rep SourceCode :: Type -> Type Source #

ToJSON SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

FromJSON SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

Newtype SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type O SourceCode Source #

type Rep SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep SourceCode = D1 ('MetaData "SourceCode" "Language.Haskell.Interpreter" "playground-common-0.1.0.0-LHGPmcl6mK723R6a6rRgpE" 'True) (C1 ('MetaCons "SourceCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
type O SourceCode Source # 
Instance details

Defined in Language.Haskell.Interpreter

newtype Warning Source #

Constructors

Warning Text 

Instances

Instances details
Eq Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

Show Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

Generic Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type Rep Warning :: Type -> Type Source #

ToJSON Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

FromJSON Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep Warning Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep Warning = D1 ('MetaData "Warning" "Language.Haskell.Interpreter" "playground-common-0.1.0.0-LHGPmcl6mK723R6a6rRgpE" 'True) (C1 ('MetaCons "Warning" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data InterpreterResult a Source #

Constructors

InterpreterResult 

Fields

Instances

Instances details
Functor InterpreterResult Source # 
Instance details

Defined in Language.Haskell.Interpreter

Eq a => Eq (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

Show a => Show (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

Generic (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

Associated Types

type Rep (InterpreterResult a) :: Type -> Type Source #

ToJSON a => ToJSON (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

FromJSON a => FromJSON (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep (InterpreterResult a) Source # 
Instance details

Defined in Language.Haskell.Interpreter

type Rep (InterpreterResult a) = D1 ('MetaData "InterpreterResult" "Language.Haskell.Interpreter" "playground-common-0.1.0.0-LHGPmcl6mK723R6a6rRgpE" 'False) (C1 ('MetaCons "InterpreterResult" 'PrefixI 'True) (S1 ('MetaSel ('Just "warnings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Warning]) :*: S1 ('MetaSel ('Just "result") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))