{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
module Test.Sandwich.RunTree where
import Control.Concurrent.STM
import GHC.Stack
import Test.Sandwich.Types.RunTree
import Test.Sandwich.Types.Spec
extractValues :: (forall context. RunNodeWithStatus context s l t -> a) -> RunNodeWithStatus context s l t -> [a]
forall context. RunNodeWithStatus context s l t -> a
f node :: RunNodeWithStatus context s l t
node@(RunNodeIt {}) = [RunNodeWithStatus context s l t -> a
forall context. RunNodeWithStatus context s l t -> a
f RunNodeWithStatus context s l t
node]
extractValues forall context. RunNodeWithStatus context s l t -> a
f node :: RunNodeWithStatus context s l t
node@(RunNodeIntroduce {[RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: ()
runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented}) = (RunNodeWithStatus context s l t -> a
forall context. RunNodeWithStatus context s l t -> a
f RunNodeWithStatus context s l t
node) a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a])
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus context s l t -> [a]
extractValues forall context. RunNodeWithStatus context s l t -> a
f) [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented)
extractValues forall context. RunNodeWithStatus context s l t -> a
f node :: RunNodeWithStatus context s l t
node@(RunNodeIntroduceWith {[RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: ()
runNodeChildrenAugmented}) = (RunNodeWithStatus context s l t -> a
forall context. RunNodeWithStatus context s l t -> a
f RunNodeWithStatus context s l t
node) a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a])
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus context s l t -> [a]
extractValues forall context. RunNodeWithStatus context s l t -> a
f) [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented)
extractValues forall context. RunNodeWithStatus context s l t -> a
f RunNodeWithStatus context s l t
node = (RunNodeWithStatus context s l t -> a
forall context. RunNodeWithStatus context s l t -> a
f RunNodeWithStatus context s l t
node) a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus context s l t -> [a])
-> [RunNodeWithStatus context s l t] -> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus context s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus context s l t -> [a]
extractValues forall context. RunNodeWithStatus context s l t -> a
f) (RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
runNodeChildren RunNodeWithStatus context s l t
node))
extractValuesControlRecurse :: (forall context. RunNodeWithStatus context s l t -> (Bool, a)) -> RunNodeWithStatus context s l t -> [a]
forall context. RunNodeWithStatus context s l t -> (Bool, a)
f node :: RunNodeWithStatus context s l t
node@(RunNodeIt {}) = [(Bool, a) -> a
forall a b. (a, b) -> b
snd ((Bool, a) -> a) -> (Bool, a) -> a
forall a b. (a -> b) -> a -> b
$ RunNodeWithStatus context s l t -> (Bool, a)
forall context. RunNodeWithStatus context s l t -> (Bool, a)
f RunNodeWithStatus context s l t
node]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f node :: RunNodeWithStatus context s l t
node@(RunNodeIntroduce {[RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: ()
runNodeChildrenAugmented}) = case RunNodeWithStatus context s l t -> (Bool, a)
forall context. RunNodeWithStatus context s l t -> (Bool, a)
f RunNodeWithStatus context s l t
node of
(Bool
True, a
x) -> a
x a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a])
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus context s l t -> [a]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f) [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented)
(Bool
False, a
x) -> [a
x]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f node :: RunNodeWithStatus context s l t
node@(RunNodeIntroduceWith {[RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented :: ()
runNodeChildrenAugmented}) = case RunNodeWithStatus context s l t -> (Bool, a)
forall context. RunNodeWithStatus context s l t -> (Bool, a)
f RunNodeWithStatus context s l t
node of
(Bool
True, a
x) -> a
x a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a])
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus (LabelValue lab intro :> context) s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus context s l t -> [a]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f) [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
runNodeChildrenAugmented)
(Bool
False, a
x) -> [a
x]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f RunNodeWithStatus context s l t
node = case RunNodeWithStatus context s l t -> (Bool, a)
forall context. RunNodeWithStatus context s l t -> (Bool, a)
f RunNodeWithStatus context s l t
node of
(Bool
True, a
x) -> a
x a -> [a] -> [a]
forall a. a -> [a] -> [a]
: ((RunNodeWithStatus context s l t -> [a])
-> [RunNodeWithStatus context s l t] -> [a]
forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap ((forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus context s l t -> [a]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> (Bool, a))
-> RunNodeWithStatus context s l t -> [a]
extractValuesControlRecurse forall context. RunNodeWithStatus context s l t -> (Bool, a)
f) (RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
runNodeChildren RunNodeWithStatus context s l t
node))
(Bool
False, a
x) -> [a
x]
getCommons :: RunNodeWithStatus context s l t -> [RunNodeCommonWithStatus s l t]
getCommons :: RunNodeWithStatus context s l t -> [RunNodeCommonWithStatus s l t]
getCommons = (forall context.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t)
-> RunNodeWithStatus context s l t
-> [RunNodeCommonWithStatus s l t]
forall s l t a context.
(forall context. RunNodeWithStatus context s l t -> a)
-> RunNodeWithStatus context s l t -> [a]
extractValues forall context.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeCommon
fixRunTree :: RunNode context -> STM (RunNodeFixed context)
fixRunTree :: RunNode context -> STM (RunNodeFixed context)
fixRunTree node :: RunNode context
node@(RunNode context
-> RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeCommon -> (RunNodeCommonWithStatus {Bool
Int
String
Maybe String
Maybe SrcLoc
Var Bool
Var (Seq LogEntry)
Var Status
Seq Int
runTreeLoc :: forall s l t. RunNodeCommonWithStatus s l t -> Maybe SrcLoc
runTreeLogs :: forall s l t. RunNodeCommonWithStatus s l t -> l
runTreeRecordTime :: forall s l t. RunNodeCommonWithStatus s l t -> Bool
runTreeVisibilityLevel :: forall s l t. RunNodeCommonWithStatus s l t -> Int
runTreeFolder :: forall s l t. RunNodeCommonWithStatus s l t -> Maybe String
runTreeVisible :: forall s l t. RunNodeCommonWithStatus s l t -> Bool
runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s
runTreeOpen :: forall s l t. RunNodeCommonWithStatus s l t -> t
runTreeToggled :: forall s l t. RunNodeCommonWithStatus s l t -> t
runTreeAncestors :: forall s l t. RunNodeCommonWithStatus s l t -> Seq Int
runTreeId :: forall s l t. RunNodeCommonWithStatus s l t -> Int
runTreeLabel :: forall s l t. RunNodeCommonWithStatus s l t -> String
runTreeLoc :: Maybe SrcLoc
runTreeLogs :: Var (Seq LogEntry)
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeStatus :: Var Status
runTreeOpen :: Var Bool
runTreeToggled :: Var Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
..})) = do
Status
status <- Var Status -> STM Status
forall a. TVar a -> STM a
readTVar Var Status
runTreeStatus
Seq LogEntry
logs <- Var (Seq LogEntry) -> STM (Seq LogEntry)
forall a. TVar a -> STM a
readTVar Var (Seq LogEntry)
runTreeLogs
Bool
toggled <- Var Bool -> STM Bool
forall a. TVar a -> STM a
readTVar Var Bool
runTreeToggled
Bool
open <- Var Bool -> STM Bool
forall a. TVar a -> STM a
readTVar Var Bool
runTreeOpen
let common' :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common' = RunNodeCommonWithStatus :: forall s l t.
String
-> Int
-> Seq Int
-> t
-> t
-> s
-> Bool
-> Maybe String
-> Int
-> Bool
-> l
-> Maybe SrcLoc
-> RunNodeCommonWithStatus s l t
RunNodeCommonWithStatus {
runTreeStatus :: Status
runTreeStatus = Status
status
, runTreeLogs :: Seq LogEntry
runTreeLogs = Seq LogEntry
logs
, runTreeToggled :: Bool
runTreeToggled = Bool
toggled
, runTreeOpen :: Bool
runTreeOpen = Bool
open
, Bool
Int
String
Maybe String
Maybe SrcLoc
Seq Int
runTreeLoc :: Maybe SrcLoc
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
runTreeLoc :: Maybe SrcLoc
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
..
}
case RunNode context
node of
RunNodeBefore {[RunNode context]
ExampleT context IO ()
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeBefore :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeBefore :: ExampleT context IO ()
runNodeChildren :: [RunNode context]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNodeFixed context]
children <- (RunNode context -> STM (RunNodeFixed context))
-> [RunNode context] -> STM [RunNodeFixed context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNode context -> STM (RunNodeFixed context)
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNode context]
runNodeChildren
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeBefore :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> ExampleT context IO ()
-> RunNodeWithStatus context s l t
RunNodeBefore { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildren :: [RunNodeFixed context]
runNodeChildren=[RunNodeFixed context]
children, ExampleT context IO ()
runNodeBefore :: ExampleT context IO ()
runNodeBefore :: ExampleT context IO ()
.. }
RunNodeAfter {[RunNode context]
ExampleT context IO ()
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeAfter :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeAfter :: ExampleT context IO ()
runNodeChildren :: [RunNode context]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNodeFixed context]
children <- (RunNode context -> STM (RunNodeFixed context))
-> [RunNode context] -> STM [RunNodeFixed context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNode context -> STM (RunNodeFixed context)
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNode context]
runNodeChildren
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeAfter :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> ExampleT context IO ()
-> RunNodeWithStatus context s l t
RunNodeAfter { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildren :: [RunNodeFixed context]
runNodeChildren=[RunNodeFixed context]
children, ExampleT context IO ()
runNodeAfter :: ExampleT context IO ()
runNodeAfter :: ExampleT context IO ()
.. }
RunNodeIntroduce {[RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
ExampleT context IO intro
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
intro -> ExampleT context IO ()
runNodeCleanup :: ()
runNodeAlloc :: ()
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
runNodeChildrenAugmented :: [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildrenAugmented :: ()
..} -> do
[RunNodeFixed (LabelValue lab intro :> context)]
children <- (RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)
-> STM (RunNodeFixed (LabelValue lab intro :> context)))
-> [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
-> STM [RunNodeFixed (LabelValue lab intro :> context)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)
-> STM (RunNodeFixed (LabelValue lab intro :> context))
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
runNodeChildrenAugmented
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeIntroduce :: forall intro s l t (lab :: Symbol) context.
Typeable intro =>
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> ExampleT context IO intro
-> (intro -> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeIntroduce { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildrenAugmented :: [RunNodeFixed (LabelValue lab intro :> context)]
runNodeChildrenAugmented=[RunNodeFixed (LabelValue lab intro :> context)]
children, ExampleT context IO intro
intro -> ExampleT context IO ()
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
.. }
RunNodeIntroduceWith {[RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
(intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeChildrenAugmented :: [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildrenAugmented :: ()
..} -> do
[RunNodeFixed (LabelValue lab intro :> context)]
children <- (RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)
-> STM (RunNodeFixed (LabelValue lab intro :> context)))
-> [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
-> STM [RunNodeFixed (LabelValue lab intro :> context)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)
-> STM (RunNodeFixed (LabelValue lab intro :> context))
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNodeWithStatus
(LabelValue lab intro :> context)
(Var Status)
(Var (Seq LogEntry))
(Var Bool)]
runNodeChildrenAugmented
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeIntroduceWith :: forall s l t (lab :: Symbol) intro context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> ((intro -> ExampleT context IO [Result])
-> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeIntroduceWith { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildrenAugmented :: [RunNodeFixed (LabelValue lab intro :> context)]
runNodeChildrenAugmented=[RunNodeFixed (LabelValue lab intro :> context)]
children, (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
.. }
RunNodeAround {[RunNode context]
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: forall context s l t.
RunNodeWithStatus context s l t
-> ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
runNodeChildren :: [RunNode context]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNodeFixed context]
children <- (RunNode context -> STM (RunNodeFixed context))
-> [RunNode context] -> STM [RunNodeFixed context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNode context -> STM (RunNodeFixed context)
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNode context]
runNodeChildren
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeAround :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> (ExampleT context IO [Result] -> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeAround { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildren :: [RunNodeFixed context]
runNodeChildren=[RunNodeFixed context]
children, ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
.. }
RunNodeDescribe {[RunNode context]
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeChildren :: [RunNode context]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNodeFixed context]
children <- (RunNode context -> STM (RunNodeFixed context))
-> [RunNode context] -> STM [RunNodeFixed context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNode context -> STM (RunNodeFixed context)
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNode context]
runNodeChildren
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeDescribe :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> RunNodeWithStatus context s l t
RunNodeDescribe { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildren :: [RunNodeFixed context]
runNodeChildren=[RunNodeFixed context]
children, .. }
RunNodeParallel {[RunNode context]
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeChildren :: [RunNode context]
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNodeFixed context]
children <- (RunNode context -> STM (RunNodeFixed context))
-> [RunNode context] -> STM [RunNodeFixed context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNode context -> STM (RunNodeFixed context)
forall context. RunNode context -> STM (RunNodeFixed context)
fixRunTree [RunNode context]
runNodeChildren
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeParallel :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> RunNodeWithStatus context s l t
RunNodeParallel { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', runNodeChildren :: [RunNodeFixed context]
runNodeChildren=[RunNodeFixed context]
children, .. }
RunNodeIt {ExampleT context IO ()
RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeExample :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeExample :: ExampleT context IO ()
runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
..} -> do
RunNodeFixed context -> STM (RunNodeFixed context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNodeFixed context -> STM (RunNodeFixed context))
-> RunNodeFixed context -> STM (RunNodeFixed context)
forall a b. (a -> b) -> a -> b
$ RunNodeIt :: forall s l t context.
RunNodeCommonWithStatus s l t
-> ExampleT context IO () -> RunNodeWithStatus context s l t
RunNodeIt { runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon=RunNodeCommonWithStatus Status (Seq LogEntry) Bool
common', ExampleT context IO ()
runNodeExample :: ExampleT context IO ()
runNodeExample :: ExampleT context IO ()
.. }
unFixRunTree :: RunNodeFixed context -> STM (RunNode context)
unFixRunTree :: RunNodeFixed context -> STM (RunNode context)
unFixRunTree node :: RunNodeFixed context
node@(RunNodeFixed context
-> RunNodeCommonWithStatus Status (Seq LogEntry) Bool
forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeCommon -> (RunNodeCommonWithStatus {Bool
Int
String
Maybe String
Maybe SrcLoc
Seq Int
Seq LogEntry
Status
runTreeLoc :: Maybe SrcLoc
runTreeLogs :: Seq LogEntry
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeStatus :: Status
runTreeOpen :: Bool
runTreeToggled :: Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
runTreeLoc :: forall s l t. RunNodeCommonWithStatus s l t -> Maybe SrcLoc
runTreeLogs :: forall s l t. RunNodeCommonWithStatus s l t -> l
runTreeRecordTime :: forall s l t. RunNodeCommonWithStatus s l t -> Bool
runTreeVisibilityLevel :: forall s l t. RunNodeCommonWithStatus s l t -> Int
runTreeFolder :: forall s l t. RunNodeCommonWithStatus s l t -> Maybe String
runTreeVisible :: forall s l t. RunNodeCommonWithStatus s l t -> Bool
runTreeStatus :: forall s l t. RunNodeCommonWithStatus s l t -> s
runTreeOpen :: forall s l t. RunNodeCommonWithStatus s l t -> t
runTreeToggled :: forall s l t. RunNodeCommonWithStatus s l t -> t
runTreeAncestors :: forall s l t. RunNodeCommonWithStatus s l t -> Seq Int
runTreeId :: forall s l t. RunNodeCommonWithStatus s l t -> Int
runTreeLabel :: forall s l t. RunNodeCommonWithStatus s l t -> String
..})) = do
Var Status
status <- Status -> STM (Var Status)
forall a. a -> STM (TVar a)
newTVar Status
runTreeStatus
Var (Seq LogEntry)
logs <- Seq LogEntry -> STM (Var (Seq LogEntry))
forall a. a -> STM (TVar a)
newTVar Seq LogEntry
runTreeLogs
Var Bool
toggled <- Bool -> STM (Var Bool)
forall a. a -> STM (TVar a)
newTVar Bool
runTreeToggled
Var Bool
open <- Bool -> STM (Var Bool)
forall a. a -> STM (TVar a)
newTVar Bool
runTreeOpen
let common' :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common' = RunNodeCommonWithStatus :: forall s l t.
String
-> Int
-> Seq Int
-> t
-> t
-> s
-> Bool
-> Maybe String
-> Int
-> Bool
-> l
-> Maybe SrcLoc
-> RunNodeCommonWithStatus s l t
RunNodeCommonWithStatus {
runTreeStatus :: Var Status
runTreeStatus = Var Status
status
, runTreeLogs :: Var (Seq LogEntry)
runTreeLogs = Var (Seq LogEntry)
logs
, runTreeToggled :: Var Bool
runTreeToggled = Var Bool
toggled
, runTreeOpen :: Var Bool
runTreeOpen = Var Bool
open
, Bool
Int
String
Maybe String
Maybe SrcLoc
Seq Int
runTreeLoc :: Maybe SrcLoc
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
runTreeLoc :: Maybe SrcLoc
runTreeRecordTime :: Bool
runTreeVisibilityLevel :: Int
runTreeFolder :: Maybe String
runTreeVisible :: Bool
runTreeAncestors :: Seq Int
runTreeId :: Int
runTreeLabel :: String
..
}
case RunNodeFixed context
node of
RunNodeBefore {[RunNodeFixed context]
ExampleT context IO ()
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeBefore :: ExampleT context IO ()
runNodeChildren :: [RunNodeFixed context]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeBefore :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNode context]
children <- (RunNodeFixed context -> STM (RunNode context))
-> [RunNodeFixed context] -> STM [RunNode context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeFixed context -> STM (RunNode context)
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeFixed context]
runNodeChildren
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeBefore :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> ExampleT context IO ()
-> RunNodeWithStatus context s l t
RunNodeBefore { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildren :: [RunNode context]
runNodeChildren=[RunNode context]
children, ExampleT context IO ()
runNodeBefore :: ExampleT context IO ()
runNodeBefore :: ExampleT context IO ()
.. }
RunNodeAfter {[RunNodeFixed context]
ExampleT context IO ()
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeAfter :: ExampleT context IO ()
runNodeChildren :: [RunNodeFixed context]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeAfter :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNode context]
children <- (RunNodeFixed context -> STM (RunNode context))
-> [RunNodeFixed context] -> STM [RunNode context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeFixed context -> STM (RunNode context)
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeFixed context]
runNodeChildren
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeAfter :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> ExampleT context IO ()
-> RunNodeWithStatus context s l t
RunNodeAfter { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildren :: [RunNode context]
runNodeChildren=[RunNode context]
children, ExampleT context IO ()
runNodeAfter :: ExampleT context IO ()
runNodeAfter :: ExampleT context IO ()
.. }
RunNodeIntroduce {[RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
ExampleT context IO intro
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
intro -> ExampleT context IO ()
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
runNodeChildrenAugmented :: [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCleanup :: ()
runNodeAlloc :: ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildrenAugmented :: ()
..} -> do
[RunNode (LabelValue lab intro :> context)]
children <- (RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool
-> STM (RunNode (LabelValue lab intro :> context)))
-> [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
-> STM [RunNode (LabelValue lab intro :> context)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool
-> STM (RunNode (LabelValue lab intro :> context))
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
runNodeChildrenAugmented
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeIntroduce :: forall intro s l t (lab :: Symbol) context.
Typeable intro =>
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> ExampleT context IO intro
-> (intro -> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeIntroduce { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildrenAugmented :: [RunNode (LabelValue lab intro :> context)]
runNodeChildrenAugmented=[RunNode (LabelValue lab intro :> context)]
children, ExampleT context IO intro
intro -> ExampleT context IO ()
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
runNodeCleanup :: intro -> ExampleT context IO ()
runNodeAlloc :: ExampleT context IO intro
.. }
RunNodeIntroduceWith {[RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
(intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeChildrenAugmented :: [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeIntroduceAction :: ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildrenAugmented :: ()
..} -> do
[RunNode (LabelValue lab intro :> context)]
children <- (RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool
-> STM (RunNode (LabelValue lab intro :> context)))
-> [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
-> STM [RunNode (LabelValue lab intro :> context)]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool
-> STM (RunNode (LabelValue lab intro :> context))
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeWithStatus
(LabelValue lab intro :> context) Status (Seq LogEntry) Bool]
runNodeChildrenAugmented
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeIntroduceWith :: forall s l t (lab :: Symbol) intro context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus (LabelValue lab intro :> context) s l t]
-> ((intro -> ExampleT context IO [Result])
-> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeIntroduceWith { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildrenAugmented :: [RunNode (LabelValue lab intro :> context)]
runNodeChildrenAugmented=[RunNode (LabelValue lab intro :> context)]
children, (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
runNodeIntroduceAction :: (intro -> ExampleT context IO [Result]) -> ExampleT context IO ()
.. }
RunNodeAround {[RunNodeFixed context]
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
runNodeChildren :: [RunNodeFixed context]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeActionWith :: forall context s l t.
RunNodeWithStatus context s l t
-> ExampleT context IO [Result] -> ExampleT context IO ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNode context]
children <- (RunNodeFixed context -> STM (RunNode context))
-> [RunNodeFixed context] -> STM [RunNode context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeFixed context -> STM (RunNode context)
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeFixed context]
runNodeChildren
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeAround :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> (ExampleT context IO [Result] -> ExampleT context IO ())
-> RunNodeWithStatus context s l t
RunNodeAround { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildren :: [RunNode context]
runNodeChildren=[RunNode context]
children, ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
runNodeActionWith :: ExampleT context IO [Result] -> ExampleT context IO ()
.. }
RunNodeDescribe {[RunNodeFixed context]
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeChildren :: [RunNodeFixed context]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNode context]
children <- (RunNodeFixed context -> STM (RunNode context))
-> [RunNodeFixed context] -> STM [RunNode context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeFixed context -> STM (RunNode context)
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeFixed context]
runNodeChildren
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeDescribe :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> RunNodeWithStatus context s l t
RunNodeDescribe { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildren :: [RunNode context]
runNodeChildren=[RunNode context]
children, .. }
RunNodeParallel {[RunNodeFixed context]
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeChildren :: [RunNodeFixed context]
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
runNodeChildren :: forall context s l t.
RunNodeWithStatus context s l t
-> [RunNodeWithStatus context s l t]
..} -> do
[RunNode context]
children <- (RunNodeFixed context -> STM (RunNode context))
-> [RunNodeFixed context] -> STM [RunNode context]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM RunNodeFixed context -> STM (RunNode context)
forall context. RunNodeFixed context -> STM (RunNode context)
unFixRunTree [RunNodeFixed context]
runNodeChildren
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeParallel :: forall s l t context.
RunNodeCommonWithStatus s l t
-> [RunNodeWithStatus context s l t]
-> RunNodeWithStatus context s l t
RunNodeParallel { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', runNodeChildren :: [RunNode context]
runNodeChildren=[RunNode context]
children, .. }
RunNodeIt {ExampleT context IO ()
RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeExample :: ExampleT context IO ()
runNodeCommon :: RunNodeCommonWithStatus Status (Seq LogEntry) Bool
runNodeExample :: forall context s l t.
RunNodeWithStatus context s l t -> ExampleT context IO ()
runNodeCommon :: forall context s l t.
RunNodeWithStatus context s l t -> RunNodeCommonWithStatus s l t
..} -> do
RunNode context -> STM (RunNode context)
forall (m :: * -> *) a. Monad m => a -> m a
return (RunNode context -> STM (RunNode context))
-> RunNode context -> STM (RunNode context)
forall a b. (a -> b) -> a -> b
$ RunNodeIt :: forall s l t context.
RunNodeCommonWithStatus s l t
-> ExampleT context IO () -> RunNodeWithStatus context s l t
RunNodeIt { runNodeCommon :: RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
runNodeCommon=RunNodeCommonWithStatus
(Var Status) (Var (Seq LogEntry)) (Var Bool)
common', ExampleT context IO ()
runNodeExample :: ExampleT context IO ()
runNodeExample :: ExampleT context IO ()
.. }
getCallStackFromStatus :: Status -> Maybe CallStack
getCallStackFromStatus :: Status -> Maybe CallStack
getCallStackFromStatus Done {statusResult :: Status -> Result
statusResult=(Failure FailureReason
reason)} = FailureReason -> Maybe CallStack
failureCallStack FailureReason
reason
getCallStackFromStatus Status
_ = Maybe CallStack
forall a. Maybe a
Nothing
isDone :: Status -> Bool
isDone :: Status -> Bool
isDone (Done {}) = Bool
True
isDone Status
_ = Bool
False
isRunning :: Status -> Bool
isRunning :: Status -> Bool
isRunning (Running {}) = Bool
True
isRunning Status
_ = Bool
False
isFailureStatus :: Status -> Bool
isFailureStatus :: Status -> Bool
isFailureStatus (Done UTCTime
_ UTCTime
_ Result
stat) = Result -> Bool
isFailure Result
stat
isFailureStatus Status
_ = Bool
False
isFailure :: Result -> Bool
isFailure :: Result -> Bool
isFailure (Failure (Pending {})) = Bool
False
isFailure (Failure {}) = Bool
True
isFailure Result
_ = Bool
False
isPending :: Result -> Bool
isPending :: Result -> Bool
isPending (Failure (Pending {})) = Bool
True
isPending Result
_ = Bool
False
whenFailure :: (Monad m) => Result -> (FailureReason -> m ()) -> m ()
whenFailure :: Result -> (FailureReason -> m ()) -> m ()
whenFailure (Failure (Pending {})) FailureReason -> m ()
_ = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
whenFailure (Failure FailureReason
reason) FailureReason -> m ()
action = FailureReason -> m ()
action FailureReason
reason
whenFailure Result
_ FailureReason -> m ()
_ = () -> m ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()