Commit cba5d796 authored by Steffen Michels's avatar Steffen Michels

avoid using gDefault in definition of foreverIf/forever

parent fa57fe7b
Pipeline #25408 passed with stage
in 5 minutes and 10 seconds
......@@ -186,14 +186,14 @@ sequence :: ![Task a] -> Task [a] | iTask a
foreverStIf :: (a -> Bool) a !(a -> Task a) -> Task a | iTask a
/**
* Repeats a task until while a predicate holds
* Repeats a task while a predicate holds
*
* @param Predicate: The predicate that has to hold
* @param Task: The task that has to be repeate
* @return The combined task
* @type (a -> Bool) !(a -> Task a) -> Task a | iTask a
*/
foreverIf pred task :== foreverStIf pred gDefault{|*|} \_->task
foreverIf pred task :== (foreverStIf (maybe True pred) Nothing \_->task @ Just) @? tvFromMaybe
/**
* Repeats a task indefinitely while carrying a state
......@@ -212,7 +212,7 @@ foreverSt initialState task :== foreverStIf (\_->True) initialState task
* @return The combined task
* @type (Task a) -> Task a | iTask a
*/
forever task :== foreverSt gDefault{|*|} \_->task
forever task :== (foreverSt Nothing \_->task @ Just) @? tvFromMaybe
/**
* Group two tasks in parallel, return the result of the first completed task.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment