aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source')
-rw-r--r--stdlib/source/lux/control/writer.lux (renamed from stdlib/source/lux/data/log.lux)30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/log.lux b/stdlib/source/lux/control/writer.lux
index 19753199f..6a82df77c 100644
--- a/stdlib/source/lux/data/log.lux
+++ b/stdlib/source/lux/control/writer.lux
@@ -5,20 +5,20 @@
functor
[monad #+ do Monad]))
-(type: #export (Log l a)
+(type: #export (Writer l a)
{#;doc "Represents a value with an associated 'log' value to record arbitrary information."}
{#log l
#value a})
-(struct: #export Functor<Log> (All [l]
- (Functor (Log l)))
+(struct: #export Functor<Writer> (All [l]
+ (Functor (Writer l)))
(def: (map f fa)
(let [[log datum] fa]
[log (f datum)])))
-(struct: #export (Applicative<Log> mon) (All [l]
- (-> (Monoid l) (Applicative (Log l))))
- (def: functor Functor<Log>)
+(struct: #export (Applicative<Writer> mon) (All [l]
+ (-> (Monoid l) (Applicative (Writer l))))
+ (def: functor Functor<Writer>)
(def: (wrap x)
[(:: mon unit) x])
@@ -28,9 +28,9 @@
[log2 a] fa]
[(:: mon append log1 log2) (f a)])))
-(struct: #export (Monad<Log> mon) (All [l]
- (-> (Monoid l) (Monad (Log l))))
- (def: applicative (Applicative<Log> mon))
+(struct: #export (Monad<Writer> mon) (All [l]
+ (-> (Monoid l) (Monad (Writer l))))
+ (def: applicative (Applicative<Writer> mon))
(def: (join mma)
(let [[log1 [log2 a]] mma]
@@ -38,21 +38,21 @@
(def: #export (log l)
{#;doc "Set the log to a particular value."}
- (All [l] (-> l (Log l Unit)))
+ (All [l] (-> l (Writer l Unit)))
[l []])
-(struct: #export (LogT Monoid<l> Monad<M>)
- (All [l M] (-> (Monoid l) (Monad M) (Monad (All [a] (M (Log l a))))))
- (def: applicative (A;compA (get@ #monad;applicative Monad<M>) (Applicative<Log> Monoid<l>)))
+(struct: #export (WriterT Monoid<l> Monad<M>)
+ (All [l M] (-> (Monoid l) (Monad M) (Monad (All [a] (M (Writer l a))))))
+ (def: applicative (A;compA (get@ #monad;applicative Monad<M>) (Applicative<Writer> Monoid<l>)))
(def: (join MlMla)
(do Monad<M>
- [[l1 Mla] (: (($ +1) (Log ($ +0) (($ +1) (Log ($ +0) ($ +2)))))
+ [[l1 Mla] (: (($ +1) (Writer ($ +0) (($ +1) (Writer ($ +0) ($ +2)))))
MlMla)
[l2 a] Mla]
(wrap [(:: Monoid<l> append l1 l2) a]))))
(def: #export (lift Monoid<l> Monad<M>)
- (All [l M a] (-> (Monoid l) (Monad M) (-> (M a) (M (Log l a)))))
+ (All [l M a] (-> (Monoid l) (Monad M) (-> (M a) (M (Writer l a)))))
(function [ma]
(do Monad<M>
[a ma]