diff options
author | Eduardo Julian | 2021-07-28 04:48:42 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-07-28 04:48:42 -0400 |
commit | 5d4583aebd00adced10275b32ff1a93ab418be50 (patch) | |
tree | 89315e104e2b0ddd6d56f894f01a0575d3078699 /stdlib/source/library/lux/control/concurrency/frp.lux | |
parent | 061fd8a209bbcaffc2bfb850ac6046752a567d50 (diff) |
Re-named List's tags: Nil => End && Cons => Item
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/control/concurrency/frp.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/library/lux/control/concurrency/frp.lux b/stdlib/source/library/lux/control/concurrency/frp.lux index 9bda3c334..beecb2511 100644 --- a/stdlib/source/library/lux/control/concurrency/frp.lux +++ b/stdlib/source/library/lux/control/concurrency/frp.lux @@ -102,9 +102,9 @@ (def: (apply ff fa) (do async.monad - [cons_f ff - cons_a fa] - (case [cons_f cons_a] + [item_f ff + item_a fa] + (case [item_f item_a] [(#.Some [head_f tail_f]) (#.Some [head_a tail_a])] (in (#.Some [(head_f head_a) (apply tail_f tail_a)])) @@ -157,8 +157,8 @@ (io (exec (: (Async Any) (loop [channel channel] (do async.monad - [cons channel] - (case cons + [item channel] + (case item (#.Some [head tail]) (case (io.run (subscriber head)) (#.Some _) @@ -176,8 +176,8 @@ "that pass the test.")} (All [a] (-> (-> a Bit) (Channel a) (Channel a))) (do async.monad - [cons channel] - (case cons + [item channel] + (case item (#.Some [head tail]) (let [tail' (only pass? tail)] (if (pass? head) @@ -200,8 +200,8 @@ (-> (-> b a (Async a)) a (Channel b) (Async a))) (do {! async.monad} - [cons channel] - (case cons + [item channel] + (case item #.None (in init) @@ -215,8 +215,8 @@ (-> (-> b a (Async a)) a (Channel b) (Channel a))) (do {! async.monad} - [cons channel] - (case cons + [item channel] + (case item #.None (in (#.Some [init (in #.None)])) @@ -254,8 +254,8 @@ (def: (distinct' equivalence previous channel) (All [a] (-> (Equivalence a) a (Channel a) (Channel a))) (do async.monad - [cons channel] - (case cons + [item channel] + (case item (#.Some [head tail]) (if (\ equivalence = previous head) (distinct' equivalence previous tail) @@ -267,8 +267,8 @@ (def: #export (distinct equivalence channel) (All [a] (-> (Equivalence a) (Channel a) (Channel a))) (do async.monad - [cons channel] - (case cons + [item channel] + (case item (#.Some [head tail]) (in (#.Some [head (distinct' equivalence head tail)])) @@ -278,23 +278,23 @@ (def: #export (consume channel) (All [a] (-> (Channel a) (Async (List a)))) (do {! async.monad} - [cons channel] - (case cons + [item channel] + (case item (#.Some [head tail]) - (\ ! map (|>> (#.Cons head)) + (\ ! map (|>> (#.Item head)) (consume tail)) #.None - (in #.Nil)))) + (in #.End)))) (def: #export (sequential milli_seconds values) {#.doc (doc "Transforms the given list into a channel with the same elements.")} (All [a] (-> Nat (List a) (Channel a))) (case values - #.Nil + #.End ..empty - (#.Cons head tail) + (#.Item head tail) (async.resolved (#.Some [head (do async.monad [_ (async.wait milli_seconds)] (sequential milli_seconds tail))])))) |