aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/format
diff options
context:
space:
mode:
authorEduardo Julian2022-06-26 18:37:05 -0400
committerEduardo Julian2022-06-26 18:37:05 -0400
commit9f6505491e8a5c8a159ce094fe0af6f4fef0c5cf (patch)
treed497c163e477406a388460eedea80fdd6ee9748a /stdlib/source/format
parent3053fd79bc6ae42415298ee056a268dc2c9b690c (diff)
Re-named "format/lux/data/binary.Writer" to "Format".
Diffstat (limited to 'stdlib/source/format')
-rw-r--r--stdlib/source/format/lux/data/binary.lux58
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/format/lux/data/binary.lux b/stdlib/source/format/lux/data/binary.lux
index 23b1e9c39..8d31c23cc 100644
--- a/stdlib/source/format/lux/data/binary.lux
+++ b/stdlib/source/format/lux/data/binary.lux
@@ -70,16 +70,16 @@
[(n#+ sizeL sizeR)
(|>> mutL mutR)])))
-(.type .public (Writer a)
+(.type .public (Format a)
(-> a Specification))
-(def .public (result writer value)
- (All (_ a) (-> (Writer a) a Binary))
- (..instance (writer value)))
+(def .public (result format value)
+ (All (_ a) (-> (Format a) a Binary))
+ (..instance (format value)))
(with_template [<name> <size> <write>]
[(def .public <name>
- (Writer (I64 Any))
+ (Format (I64 Any))
(function (_ value)
[<size>
(function (_ [offset binary])
@@ -93,12 +93,12 @@
)
(def .public (or left right)
- (All (_ l r) (-> (Writer l) (Writer r) (Writer (Or l r))))
+ (All (_ l r) (-> (Format l) (Format r) (Format (Or l r))))
(function (_ altV)
(case altV
- (^.with_template [<number> <tag> <writer>]
+ (^.with_template [<number> <tag> <format>]
[{<tag> caseV}
- (let [[caseS caseT] (<writer> caseV)]
+ (let [[caseS caseT] (<format> caseV)]
[(.++ caseS)
(function (_ [offset binary])
(|> binary
@@ -110,25 +110,25 @@
)))
(def .public (and pre post)
- (All (_ a b) (-> (Writer a) (Writer b) (Writer [a b])))
+ (All (_ a b) (-> (Format a) (Format b) (Format [a b])))
(function (_ [preV postV])
(at ..monoid composite (pre preV) (post postV))))
(def .public (rec body)
- (All (_ a) (-> (-> (Writer a) (Writer a)) (Writer a)))
+ (All (_ a) (-> (-> (Format a) (Format a)) (Format a)))
(function (again value)
(body again value)))
(def .public any
- (Writer Any)
+ (Format Any)
(function.constant ..no_op))
(def .public bit
- (Writer Bit)
+ (Format Bit)
(|>> (pipe.case #0 0 #1 1) ..bits_8))
(with_template [<name> <type>]
- [(def .public <name> (Writer <type>) ..bits_64)]
+ [(def .public <name> (Format <type>) ..bits_64)]
[nat Nat]
[int Int]
@@ -136,11 +136,11 @@
)
(def .public frac
- (Writer Frac)
+ (Format Frac)
(|>> frac.bits ..bits_64))
(def .public (segment size)
- (-> Nat (Writer Binary))
+ (-> Nat (Format Binary))
(function (_ value)
[size
(function (_ [offset binary])
@@ -153,7 +153,7 @@
(with_template [<name> <bits> <size> <write>]
[(def .public <name>
- (Writer Binary)
+ (Format Binary)
(let [mask (..mask <size>)]
(function (_ value)
(let [size (|> value \\unsafe.size (i64.and mask))
@@ -173,7 +173,7 @@
(with_template [<name> <binary>]
[(def .public <name>
- (Writer Text)
+ (Format Text)
(|>> (at utf8.codec encoded) <binary>))]
[utf8_8 ..binary_8]
@@ -186,7 +186,7 @@
(with_template [<name> <size> <write>]
[(def .public (<name> valueW)
- (All (_ v) (-> (Writer v) (Writer (Sequence v))))
+ (All (_ v) (-> (Format v) (Format (Sequence v))))
(function (_ value)
(let [original_count (sequence.size value)
capped_count (i64.and (..mask <size>)
@@ -215,25 +215,25 @@
)
(def .public maybe
- (All (_ a) (-> (Writer a) (Writer (Maybe a))))
+ (All (_ a) (-> (Format a) (Format (Maybe a))))
(..or ..any))
(def .public (list value)
- (All (_ a) (-> (Writer a) (Writer (List a))))
+ (All (_ a) (-> (Format a) (Format (List a))))
(..rec
(|>> (..and value)
(..or ..any))))
(def .public (set value)
- (All (_ a) (-> (Writer a) (Writer (Set a))))
+ (All (_ a) (-> (Format a) (Format (Set a))))
(|>> set.list (..list value)))
(def .public symbol
- (Writer Symbol)
+ (Format Symbol)
(..and ..text ..text))
(def .public type
- (Writer Type)
+ (Format Type)
(..rec
(function (_ again)
(let [pair (..and again again)
@@ -241,9 +241,9 @@
quantified (..and (..list again) again)]
(function (_ altV)
(case altV
- (^.with_template [<number> <tag> <writer>]
+ (^.with_template [<number> <tag> <format>]
[{<tag> caseV}
- (let [[caseS caseT] (<writer> caseV)]
+ (let [[caseS caseT] (<format> caseV)]
[(.++ caseS)
(function (_ [offset binary])
(|> binary
@@ -264,20 +264,20 @@
))))))
(def .public location
- (Writer Location)
+ (Format Location)
(all ..and ..text ..nat ..nat))
(def .public code
- (Writer Code)
+ (Format Code)
(..rec
(function (_ again)
(let [sequence (..list again)]
(..and ..location
(function (_ altV)
(case altV
- (^.with_template [<number> <tag> <writer>]
+ (^.with_template [<number> <tag> <format>]
[{<tag> caseV}
- (let [[caseS caseT] (<writer> caseV)]
+ (let [[caseS caseT] (<format> caseV)]
[(.++ caseS)
(function (_ [offset binary])
(|> binary