From 9f6505491e8a5c8a159ce094fe0af6f4fef0c5cf Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 26 Jun 2022 18:37:05 -0400 Subject: Re-named "format/lux/data/binary.Writer" to "Format". --- stdlib/source/format/lux/data/binary.lux | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'stdlib/source/format') 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 [ ] [(def .public - (Writer (I64 Any)) + (Format (I64 Any)) (function (_ value) [ (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 [ ] + (^.with_template [ ] [{ caseV} - (let [[caseS caseT] ( caseV)] + (let [[caseS caseT] ( 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 [ ] - [(def .public (Writer ) ..bits_64)] + [(def .public (Format ) ..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 [ ] [(def .public - (Writer Binary) + (Format Binary) (let [mask (..mask )] (function (_ value) (let [size (|> value \\unsafe.size (i64.and mask)) @@ -173,7 +173,7 @@ (with_template [ ] [(def .public - (Writer Text) + (Format Text) (|>> (at utf8.codec encoded) ))] [utf8_8 ..binary_8] @@ -186,7 +186,7 @@ (with_template [ ] [(def .public ( 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 ) @@ -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 [ ] + (^.with_template [ ] [{ caseV} - (let [[caseS caseT] ( caseV)] + (let [[caseS caseT] ( 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 [ ] + (^.with_template [ ] [{ caseV} - (let [[caseS caseT] ( caseV)] + (let [[caseS caseT] ( caseV)] [(.++ caseS) (function (_ [offset binary]) (|> binary -- cgit v1.2.3