{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE RecordWildCards #-}
module Stack.Eval
( EvalOpts (..)
, evalCmd
) where
import Stack.Exec
( ExecOpts (..), ExecOptsExtra, SpecialExecCmd (..)
, execCmd
)
import Stack.Prelude
import Stack.Types.Runner ( Runner )
data EvalOpts = EvalOpts
{ EvalOpts -> String
evalArg :: !String
, :: !ExecOptsExtra
}
deriving Int -> EvalOpts -> ShowS
[EvalOpts] -> ShowS
EvalOpts -> String
(Int -> EvalOpts -> ShowS)
-> (EvalOpts -> String) -> ([EvalOpts] -> ShowS) -> Show EvalOpts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EvalOpts -> ShowS
showsPrec :: Int -> EvalOpts -> ShowS
$cshow :: EvalOpts -> String
show :: EvalOpts -> String
$cshowList :: [EvalOpts] -> ShowS
showList :: [EvalOpts] -> ShowS
Show
evalCmd :: EvalOpts -> RIO Runner ()
evalCmd :: EvalOpts -> RIO Runner ()
evalCmd EvalOpts {String
ExecOptsExtra
evalArg :: EvalOpts -> String
evalExtra :: EvalOpts -> ExecOptsExtra
evalArg :: String
evalExtra :: ExecOptsExtra
..} = ExecOpts -> RIO Runner ()
execCmd ExecOpts
execOpts
where
execOpts :: ExecOpts
execOpts =
ExecOpts { eoCmd :: SpecialExecCmd
eoCmd = SpecialExecCmd
ExecGhc
, eoArgs :: [String]
eoArgs = [String
"-e", String
evalArg]
, eoExtra :: ExecOptsExtra
eoExtra = ExecOptsExtra
evalExtra
}