{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE OverloadedRecordDot #-}
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
arg :: !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
eval = ExecOpts -> RIO Runner ()
execCmd ExecOpts
execOpts
where
execOpts :: ExecOpts
execOpts = ExecOpts
{ cmd :: SpecialExecCmd
cmd = SpecialExecCmd
ExecGhc
, args :: [String]
args = [String
"-e", EvalOpts
eval.arg]
, extra :: ExecOptsExtra
extra = EvalOpts
eval.extra
}