diff options
author | Eduardo Julian | 2018-05-02 00:09:35 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-02 00:09:35 -0400 |
commit | e4e67f0427d93b3686366ffe9f14a4751690101e (patch) | |
tree | 22857a6ea96f97925bacc5ea2ddf71ab55207569 /stdlib/source/lux/concurrency/task.lux | |
parent | 9906f649d26adfed5126065082fb4a7d5e4696bb (diff) |
- Moved the "wrap" function into Monad, and removed Applicative from Monad's family tree.
- Moved the Free monad to its own module.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/concurrency/task.lux | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/stdlib/source/lux/concurrency/task.lux b/stdlib/source/lux/concurrency/task.lux index edb72ca6f..1ebfa181c 100644 --- a/stdlib/source/lux/concurrency/task.lux +++ b/stdlib/source/lux/concurrency/task.lux @@ -15,16 +15,16 @@ (def: #export (fail error) (All [a] (-> Text (Task a))) - (:: P.Applicative<Promise> wrap (#E.Error error))) + (:: P.Monad<Promise> wrap (#E.Error error))) (def: #export (throw exception message) (All [e a] (-> (Exception e) e (Task a))) - (:: P.Applicative<Promise> wrap + (:: P.Monad<Promise> wrap (ex.throw exception message))) (def: #export (return value) (All [a] (-> a (Task a))) - (:: P.Applicative<Promise> wrap (#E.Success value))) + (:: P.Monad<Promise> wrap (#E.Success value))) (def: #export (try computation) (All [a] (-> (Task a) (Task (E.Error a)))) @@ -45,8 +45,6 @@ (struct: #export _ (A.Applicative Task) (def: functor Functor<Task>) - (def: wrap return) - (def: (apply ff fa) (do P.Monad<Promise> [ff' ff @@ -57,7 +55,9 @@ (wrap (f a))))))) (struct: #export _ (Monad Task) - (def: applicative Applicative<Task>) + (def: functor Functor<Task>) + + (def: wrap return) (def: (join mma) (do P.Monad<Promise> |