diff options
author | Eduardo Julian | 2017-10-16 19:28:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-10-16 19:28:04 -0400 |
commit | fecfb6c1dd653e491e541233395ea4a7d8ae7409 (patch) | |
tree | 1083a8cbe6f8277a75fc7813f9a403a4db9e5732 /stdlib/source/lux/concurrency/task.lux | |
parent | b2b8a0ffda0661511d8aec5634aad314b1e6c710 (diff) |
- Re-named "Result" type back to "Error".
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/concurrency/task.lux | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/concurrency/task.lux b/stdlib/source/lux/concurrency/task.lux index 4be7ead9d..374acee46 100644 --- a/stdlib/source/lux/concurrency/task.lux +++ b/stdlib/source/lux/concurrency/task.lux @@ -1,6 +1,6 @@ (;module: lux - (lux (data ["R" result]) + (lux (data ["E" error]) (control ["F" functor] ["A" applicative] monad @@ -11,11 +11,11 @@ )) (type: #export (Task a) - (P;Promise (R;Result a))) + (P;Promise (E;Error a))) (def: #export (fail error) (All [a] (-> Text (Task a))) - (:: P;Applicative<Promise> wrap (#R;Error error))) + (:: P;Applicative<Promise> wrap (#E;Error error))) (def: #export (throw exception message) (All [a] (-> Exception Text (Task a))) @@ -23,22 +23,22 @@ (def: #export (return value) (All [a] (-> a (Task a))) - (:: P;Applicative<Promise> wrap (#R;Success value))) + (:: P;Applicative<Promise> wrap (#E;Success value))) (def: #export (try computation) - (All [a] (-> (Task a) (Task (R;Result a)))) - (:: P;Functor<Promise> map (|>. #R;Success) computation)) + (All [a] (-> (Task a) (Task (E;Error a)))) + (:: P;Functor<Promise> map (|>. #E;Success) computation)) (struct: #export _ (F;Functor Task) (def: (map f fa) (:: P;Functor<Promise> map (function [fa'] (case fa' - (#R;Error error) - (#R;Error error) + (#E;Error error) + (#E;Error error) - (#R;Success a) - (#R;Success (f a)))) + (#E;Success a) + (#E;Success (f a)))) fa))) (struct: #export _ (A;Applicative Task) @@ -50,7 +50,7 @@ (do P;Monad<Promise> [ff' ff fa' fa] - (wrap (do R;Monad<Result> + (wrap (do E;Monad<Error> [f ff' a fa'] (wrap (f a))))))) @@ -62,10 +62,10 @@ (do P;Monad<Promise> [mma' mma] (case mma' - (#R;Error error) - (wrap (#R;Error error)) + (#E;Error error) + (wrap (#E;Error error)) - (#R;Success ma) + (#E;Success ma) ma)))) (syntax: #export (task [type s;any]) @@ -76,4 +76,4 @@ (def: #export (from-promise promise) (All [a] (-> (P;Promise a) (Task a))) - (:: P;Functor<Promise> map (|>. #R;Success) promise)) + (:: P;Functor<Promise> map (|>. #E;Success) promise)) |