laborantin-hs-0.1.4.0: an experiment management framework

Safe HaskellNone

Laborantin.DSL

Synopsis

Documentation

scenario :: Monad m => Text -> State (ScenarioDescription m) () -> ScenarioDescription mSource

DSL entry point to build a ScenarioDescription.

describe :: Describable a => Text -> State a ()Source

Attach a description to the Parameter / Scnario

parameter :: Text -> State ParameterDescription () -> State (ScenarioDescription m) ()Source

DSL entry point to build a ParameterDescription within a scenario.

require :: (MonadIO m, Monad m) => ScenarioDescription m -> Text -> State (ScenarioDescription m) ()Source

Defines the TExpr Bool to load ancestor

requireTExpr :: (MonadIO m, Monad m) => ScenarioDescription m -> TExpr Bool -> State (ScenarioDescription m) ()Source

Defines the TExpr Bool to load ancestor

dependency :: Monad m => Text -> State (Dependency m) () -> State (ScenarioDescription m) ()Source

DSL entry point to build a 'Dependency a' within a scenario.

check :: (Execution m -> m Bool) -> State (Dependency m) ()Source

Set verification action for the dependency

resolve :: ((Execution m, Backend m) -> m (Execution m)) -> State (Dependency m) ()Source

Set resolution action for the dependency

values :: [ParameterValue] -> State ParameterDescription ()Source

Set default values for the paramater

str :: Text -> ParameterValueSource

Encapsulate a Text as a ParameterValue

num :: Integer -> ParameterValueSource

Encapsulate an integer value as a ParameterValue

range :: Rational -> Rational -> Rational -> ParameterValueSource

Encapsulate a range as a ParameterValue

arr :: [ParameterValue] -> ParameterValueSource

Encapsulate an array of str or num values as a ParameterValue

setup :: Step m () -> State (ScenarioDescription m) ()Source

Define the setup hook for this scenario

teardown :: Step m () -> State (ScenarioDescription m) ()Source

Define the teardown hook for this scenario

run :: Step m () -> State (ScenarioDescription m) ()Source

Define the main run hook for this scenario

self :: Monad m => Step m (Execution m)Source

Returns current execution

backend :: Monad m => Step m (Backend m)Source

Returns current backend

paramSource

Arguments

:: Monad m 
=> Text

the parameter name

-> Step m ParameterValue 

Get the parameter with given name. Throw an error if the parameter is missing.

ancestors :: Monad m => Text -> Step m [Execution m]Source

Get all ancestors for a given scenario name.

ancestorsMatching :: Monad m => Text -> Text -> Step m [Execution m]Source

Get all ancestors for a given scenario name and matching a query expressed as a string. Current implementation silences errors.

ancestorsMatchingTExpr :: Monad m => Text -> TExpr Bool -> Step m [Execution m]Source

Get all ancestors for a given scenario name and matching a TExpr Bool query.

getVarSource

Arguments

:: (Typeable v, Functor m, MonadState DynEnv m) 
=> Text

name of the variable

-> m (Maybe v) 

Get an execution variable and tries to cast it from it's Dynamic representation.

Returns Nothing if the variable is missing or if it could not be cast to the wanted type.

setVarSource

Arguments

:: (Typeable v, MonadState DynEnv m) 
=> Text

name of the variable

-> v

value of the variable

-> m () 

Set an execution variable.

recover :: (ExecutionError -> Step m ()) -> State (ScenarioDescription m) ()Source

Define the recovery hook for this scenario

analyze :: Step m () -> State (ScenarioDescription m) ()Source

Define the offline analysis hook for this scenario

result :: Monad m => FilePath -> Step m (Result m)Source

Returns a Result object for the given name.

Implementations will return their specific results.

writeResultSource

Arguments

:: Monad m 
=> FilePath

result name

-> Text

result content

-> Step m () 

Write (overwrite) the result in its entirety.

Implementations will return their specific results.

appendResultSource

Arguments

:: Monad m 
=> FilePath

result name

-> Text

content to add

-> Step m () 

Appends a chunk of data to the result.

Implementations will return their specific results.

logger :: Monad m => Step m (LogHandler m)Source

Return a LogHandler object for this scenario.

dbg :: Monad m => Text -> Step m ()Source

Sends a line of data to the logger (debug mode)

err :: Monad m => String -> Step m ()Source

Interrupts the scenario by throwing an error