diff options
author | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-06-16 00:48:19 -0400 |
commit | 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 (patch) | |
tree | 115fab5bd8a5f53dc0d13ce5453095324a83496f /stdlib/source/format | |
parent | f92c806ee8da63f04bbefbf558f6249bacdb47ea (diff) |
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to 'stdlib/source/format')
-rw-r--r-- | stdlib/source/format/lux/data/binary.lux | 56 | ||||
-rw-r--r-- | stdlib/source/format/lux/data/text.lux | 16 |
2 files changed, 36 insertions, 36 deletions
diff --git a/stdlib/source/format/lux/data/binary.lux b/stdlib/source/format/lux/data/binary.lux index a0b96a581..ed497dd3f 100644 --- a/stdlib/source/format/lux/data/binary.lux +++ b/stdlib/source/format/lux/data/binary.lux @@ -33,7 +33,7 @@ ["</>" \\parser (.only Offset Size Parser)]) (with_template [<name> <extension> <post>] - [(def: <name> + [(def <name> (template (<name> <parameter> <subject>) [(<post> (<extension> (.int <parameter>) (.int <subject>)))]))] @@ -42,7 +42,7 @@ [n#* "lux i64 *" .nat] ) -(def: mask +(def mask (-> Size (I64 Any)) (|>> (n#* i64.bits_per_byte) i64.mask)) @@ -52,33 +52,33 @@ (type: .public Specification [Size Mutation]) -(def: .public no_op +(def .public no_op Specification [0 function.identity]) -(def: .public (instance [size mutation]) +(def .public (instance [size mutation]) (-> Specification Binary) (|> size \\unsafe.empty [0] mutation product.right)) -(def: .public monoid +(def .public monoid (Monoid Specification) (implementation - (def: identity + (def identity ..no_op) - (def: (composite [sizeL mutL] [sizeR mutR]) + (def (composite [sizeL mutL] [sizeR mutR]) [(n#+ sizeL sizeR) (|>> mutL mutR)]))) (type: .public (Writer a) (-> a Specification)) -(def: .public (result writer value) +(def .public (result writer value) (All (_ a) (-> (Writer a) a Binary)) (..instance (writer value))) (with_template [<name> <size> <write>] - [(def: .public <name> + [(def .public <name> (Writer (I64 Any)) (function (_ value) [<size> @@ -92,7 +92,7 @@ [bits_64 </>.size_64 \\unsafe.has_64!] ) -(def: .public (or left right) +(def .public (or left right) (All (_ l r) (-> (Writer l) (Writer r) (Writer (Or l r)))) (function (_ altV) (case altV @@ -109,37 +109,37 @@ [1 .#Right right]) ))) -(def: .public (and pre post) +(def .public (and pre post) (All (_ a b) (-> (Writer a) (Writer b) (Writer [a b]))) (function (_ [preV postV]) (at ..monoid composite (pre preV) (post postV)))) -(def: .public (rec body) +(def .public (rec body) (All (_ a) (-> (-> (Writer a) (Writer a)) (Writer a))) (function (again value) (body again value))) -(def: .public any +(def .public any (Writer Any) (function.constant ..no_op)) -(def: .public bit +(def .public bit (Writer Bit) (|>> (pipe.case #0 0 #1 1) ..bits_8)) (with_template [<name> <type>] - [(def: .public <name> (Writer <type>) ..bits_64)] + [(def .public <name> (Writer <type>) ..bits_64)] [nat Nat] [int Int] [rev Rev] ) -(def: .public frac +(def .public frac (Writer Frac) (|>> frac.bits ..bits_64)) -(def: .public (segment size) +(def .public (segment size) (-> Nat (Writer Binary)) (function (_ value) [size @@ -152,7 +152,7 @@ binary)])])) (with_template [<name> <bits> <size> <write>] - [(def: .public <name> + [(def .public <name> (Writer Binary) (let [mask (..mask <size>)] (function (_ value) @@ -172,7 +172,7 @@ ) (with_template [<name> <binary>] - [(def: .public <name> + [(def .public <name> (Writer Text) (|>> (at utf8.codec encoded) <binary>))] @@ -182,10 +182,10 @@ [utf8_64 ..binary_64] ) -(def: .public text ..utf8_64) +(def .public text ..utf8_64) (with_template [<name> <size> <write>] - [(def: .public (<name> valueW) + [(def .public (<name> valueW) (All (_ v) (-> (Writer v) (Writer (Sequence v)))) (function (_ value) (let [original_count (sequence.size value) @@ -214,25 +214,25 @@ [sequence_64 </>.size_64 \\unsafe.has_64!] ) -(def: .public maybe +(def .public maybe (All (_ a) (-> (Writer a) (Writer (Maybe a)))) (..or ..any)) -(def: .public (list value) +(def .public (list value) (All (_ a) (-> (Writer a) (Writer (List a)))) (..rec (|>> (..and value) (..or ..any)))) -(def: .public (set value) +(def .public (set value) (All (_ a) (-> (Writer a) (Writer (Set a)))) (|>> set.list (..list value))) -(def: .public symbol +(def .public symbol (Writer Symbol) (..and ..text ..text)) -(def: .public type +(def .public type (Writer Type) (..rec (function (_ again) @@ -263,11 +263,11 @@ [10 .#Named (..and ..symbol again)]) )))))) -(def: .public location +(def .public location (Writer Location) (all ..and ..text ..nat ..nat)) -(def: .public code +(def .public code (Writer Code) (..rec (function (_ again) diff --git a/stdlib/source/format/lux/data/text.lux b/stdlib/source/format/lux/data/text.lux index 606cace14..e5b3a005c 100644 --- a/stdlib/source/format/lux/data/text.lux +++ b/stdlib/source/format/lux/data/text.lux @@ -42,18 +42,18 @@ (type: .public (Format a) (-> a Text)) -(def: .public functor +(def .public functor (contravariant.Functor Format) (implementation - (def: (each f fb) + (def (each f fb) (|>> f fb)))) -(def: .public format +(def .public format (syntax (_ [fragments (<>.many <code>.any)]) (in (.list (` (all "lux text concat" (~+ fragments))))))) (with_template [<name> <type> <formatter>] - [(def: .public <name> + [(def .public <name> (Format <type>) <formatter>)] @@ -83,7 +83,7 @@ (with_template [<type> <format>,<codec>] [(`` (with_template [<format> <codec>] - [(def: .public <format> + [(def .public <format> (Format <type>) (at <codec> encoded))] @@ -111,18 +111,18 @@ [frac_16 frac.hex]]] ) -(def: .public (mod modular) +(def .public (mod modular) (All (_ m) (Format (modular.Mod m))) (let [codec (modular.codec (modular.modulus modular))] (at codec encoded modular))) -(def: .public (list formatter) +(def .public (list formatter) (All (_ a) (-> (Format a) (Format (List a)))) (|>> (list#each (|>> formatter (format " "))) text.together (text.enclosed ["(list" ")"]))) -(def: .public (maybe format) +(def .public (maybe format) (All (_ a) (-> (Format a) (Format (Maybe a)))) (function (_ value) (case value |