From 9e2f1e76f2c8df01ed7687d934c3210fcf676bd6 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 16 Jun 2022 00:48:19 -0400 Subject: De-sigil-ification: suffix : [Part 13] --- stdlib/source/format/lux/data/binary.lux | 56 ++++++++++++++++---------------- stdlib/source/format/lux/data/text.lux | 16 ++++----- 2 files changed, 36 insertions(+), 36 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 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 [ ] - [(def: + [(def (template ( ) [( ( (.int ) (.int )))]))] @@ -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 [ ] - [(def: .public + [(def .public (Writer (I64 Any)) (function (_ value) [ @@ -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 [ ] - [(def: .public (Writer ) ..bits_64)] + [(def .public (Writer ) ..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 [ ] - [(def: .public + [(def .public (Writer Binary) (let [mask (..mask )] (function (_ value) @@ -172,7 +172,7 @@ ) (with_template [ ] - [(def: .public + [(def .public (Writer Text) (|>> (at utf8.codec encoded) ))] @@ -182,10 +182,10 @@ [utf8_64 ..binary_64] ) -(def: .public text ..utf8_64) +(def .public text ..utf8_64) (with_template [ ] - [(def: .public ( valueW) + [(def .public ( 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 .any)]) (in (.list (` (all "lux text concat" (~+ fragments))))))) (with_template [ ] - [(def: .public + [(def .public (Format ) )] @@ -83,7 +83,7 @@ (with_template [ ,] [(`` (with_template [ ] - [(def: .public + [(def .public (Format ) (at 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 -- cgit v1.2.3