diff options
author | Eduardo Julian | 2017-06-26 19:34:58 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-06-26 19:34:58 -0400 |
commit | 821b60d969dfda0302aba7aea8a93bfed2fa628d (patch) | |
tree | d3a46f3bd6e448e9ef83323287f75dc120a83306 /stdlib/source/lux/concurrency/task.lux | |
parent | b97060bb7778a7ce01ac72948f3cd9bcef5d7ec9 (diff) |
- Miscellaneous refactoring.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/concurrency/task.lux | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/source/lux/concurrency/task.lux b/stdlib/source/lux/concurrency/task.lux index f46d1f0da..6f880ef79 100644 --- a/stdlib/source/lux/concurrency/task.lux +++ b/stdlib/source/lux/concurrency/task.lux @@ -25,6 +25,10 @@ (All [a] (-> a (Task a))) (:: P;Applicative<Promise> wrap (#R;Success value))) +(def: #export (try computation) + (All [a] (-> (Task a) (Task (R;Result a)))) + (:: P;Functor<Promise> map (|>. #R;Success) computation)) + (struct: #export _ (Functor Task) (def: (map f fa) (:: P;Functor<Promise> map |