X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=stepparallel%2Ftest.icl;h=0004118f7ab93f11417c9eb35994e6cbc7636598;hb=HEAD;hp=b5253ef6c132262b45e201f0e8c4bc534e090e22;hpb=b090121d584535b129ba17bf225bef46d403d634;p=clean-tests.git diff --git a/stepparallel/test.icl b/stepparallel/test.icl deleted file mode 100644 index b5253ef..0000000 --- a/stepparallel/test.icl +++ /dev/null @@ -1,59 +0,0 @@ -module test - -import StdMisc -import iTasks -import Data.Either -import StdEnv -import Data.Func - -Start w = flip doTasks w $ - updateInformation () [] 42 - >>* [OnAction (Action "Continue") (always (return 43))] - -(>>*) infixl 1// :: !(Task a) ![TaskCont a (Task b)] -> Task b | iTask a & iTask b -(>>*) task steps :== step task (const Nothing) steps - -step :: !(Task a) ((Maybe a) -> Maybe b) [TaskCont a (Task b)] -> Task b | iTask a & iTask b -step lhs lhsValFun conts - = parallel - [(Embedded, \stl->lhs @? \v->case v of - NoValue = Value (Left Nothing) False - (Value v s) = Value (Left (Just v)) s - )] - (map stepCont conts) - @? stepVal lhsValFun -where - stepVal :: ((Maybe a) -> Maybe b) (TaskValue [(Int, TaskValue (Either (Maybe a) b))]) -> TaskValue b - stepVal tfun NoValue = NoValue - stepVal tfun (Value [(_, x):_] _) = case x of - //Not yet stepped: - Value (Left l) s = case tfun l of - Nothing = NoValue - Just v = Value v False - //Stepped but no value - NoValue = NoValue - Value (Right r) s = Value r s - stepVal _ _ = abort "cannot happen" - - stepCont :: (TaskCont a (Task b)) -> TaskCont - [(Int, TaskValue (Either (Maybe a) b))] - (ParallelTaskType, ParallelTask (Either (Maybe a) b)) - stepCont (OnValue f) = OnValue (transform f) - stepCont (OnAction a f) = OnAction a (transform f) - - transform f v - # v = case v of - Value [(_, v)] _ = case v of - NoValue = NoValue - Value (Left (Just v)) s = Value v s - Value _ = NoValue - NoValue = NoValue - = case f v of - Nothing = Nothing - Just t = Just (Embedded, \stl-> - get (sdsFocus {onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False,includeValue=False,includeProgress=False,includeAttributes=False} stl) - removeTask taskId stl - >-| t @ Right) - -// stepCont (OnException f) = OnException \e->(Embedded, \stl->e f @ Right) -// stepCont (OnAllExceptions b) = OnAllExceptions b