aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/codata/env.lux2
-rw-r--r--stdlib/source/lux/codata/state.lux9
-rw-r--r--stdlib/source/lux/data/log.lux3
-rw-r--r--stdlib/source/lux/data/maybe.lux2
-rw-r--r--stdlib/source/lux/data/struct/list.lux2
5 files changed, 12 insertions, 6 deletions
diff --git a/stdlib/source/lux/codata/env.lux b/stdlib/source/lux/codata/env.lux
index 8883b4a66..818dd8a7e 100644
--- a/stdlib/source/lux/codata/env.lux
+++ b/stdlib/source/lux/codata/env.lux
@@ -52,7 +52,7 @@
(env-proc env))
(struct: #export (EnvT Monad<M>)
- (All [M e] (-> (Monad M) (Monad (All [a] (Env e (M a))))))
+ (All [M] (-> (Monad M) (All [e] (Monad (All [a] (Env e (M a)))))))
(def: applicative (compA Applicative<Env> (get@ #M;applicative Monad<M>)))
(def: (join eMeMa)
(lambda [env]
diff --git a/stdlib/source/lux/codata/state.lux b/stdlib/source/lux/codata/state.lux
index 82e9b40fd..2ff0ea3a8 100644
--- a/stdlib/source/lux/codata/state.lux
+++ b/stdlib/source/lux/codata/state.lux
@@ -97,8 +97,15 @@
[state a] (sFa state)]
(wrap [state (f a)])))))
+(type: #export (State' M s a)
+ (-> s (M [s a])))
+
+(def: #export (run' state action)
+ (All [M s a] (-> s (State' M s a) (M [s a])))
+ (action state))
+
(struct: #export (StateT Monad<M>)
- (All [M s] (-> (Monad M) (Monad (All [a] (-> s (M [s a]))))))
+ (All [M s] (-> (Monad M) (Monad (State' M s))))
(def: applicative (Applicative<StateT> Monad<M>))
(def: (join sMsMa)
(lambda [state]
diff --git a/stdlib/source/lux/data/log.lux b/stdlib/source/lux/data/log.lux
index 6b6cd2095..687f23478 100644
--- a/stdlib/source/lux/data/log.lux
+++ b/stdlib/source/lux/data/log.lux
@@ -50,8 +50,7 @@
(do Monad<M>
[[l1 Mla] (: (($ +1) (Log ($ +0) (($ +1) (Log ($ +0) ($ +2)))))
MlMla)
- [l2 a] (: (($ +1) (Log ($ +0) ($ +2)))
- Mla)]
+ [l2 a] Mla]
(wrap [(:: Monoid<l> append l1 l2) a]))))
(def: #export (lift-log Monoid<l> Monad<M>)
diff --git a/stdlib/source/lux/data/maybe.lux b/stdlib/source/lux/data/maybe.lux
index 16aa9e30a..bf853baf1 100644
--- a/stdlib/source/lux/data/maybe.lux
+++ b/stdlib/source/lux/data/maybe.lux
@@ -75,7 +75,7 @@
(wrap #;None)
(#;Some Mma)
- (join Mma)))))
+ Mma))))
(def: #export (lift-maybe Monad<M>)
(All [M a] (-> (Monad M) (-> (M a) (M (Maybe a)))))
diff --git a/stdlib/source/lux/data/struct/list.lux b/stdlib/source/lux/data/struct/list.lux
index acd48d730..cd7323669 100644
--- a/stdlib/source/lux/data/struct/list.lux
+++ b/stdlib/source/lux/data/struct/list.lux
@@ -459,7 +459,7 @@
(do Monad<M>
[lMla MlMla
lla (: (($ +0) (List (List ($ +1))))
- (mapM @ join lMla))]
+ (seqM @ lMla))]
(wrap (concat lla)))))
(def: #export (lift-list Monad<M>)