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/library/lux/data/text/unicode/block.lux | |
parent | f92c806ee8da63f04bbefbf558f6249bacdb47ea (diff) |
De-sigil-ification: suffix : [Part 13]
Diffstat (limited to 'stdlib/source/library/lux/data/text/unicode/block.lux')
-rw-r--r-- | stdlib/source/library/lux/data/text/unicode/block.lux | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/stdlib/source/library/lux/data/text/unicode/block.lux b/stdlib/source/library/lux/data/text/unicode/block.lux index 7f3eeb32d..db55002a9 100644 --- a/stdlib/source/library/lux/data/text/unicode/block.lux +++ b/stdlib/source/library/lux/data/text/unicode/block.lux @@ -17,14 +17,14 @@ (primitive .public Block (Interval Char) - (def: .public monoid + (def .public monoid (Monoid Block) (implementation - (def: identity + (def identity (abstraction (interval.between n.enum n#top n#bottom))) - (def: (composite left right) + (def (composite left right) (let [left (representation left) right (representation right)] (abstraction @@ -34,12 +34,12 @@ (n.max (at left top) (at right top)))))))) - (def: .public (block start additional) + (def .public (block start additional) (-> Char Nat Block) (abstraction (interval.between n.enum start (n.+ additional start)))) (with_template [<name> <slot>] - [(def: .public <name> + [(def .public <name> (-> Block Char) (|>> representation (the <slot>)))] @@ -47,34 +47,34 @@ [end interval.top] ) - (def: .public (size block) + (def .public (size block) (-> Block Nat) (let [start (the interval.bottom (representation block)) end (the interval.top (representation block))] (|> end (n.- start) ++))) - (def: .public (within? block char) + (def .public (within? block char) (All (_ a) (-> Block Char Bit)) (interval.within? (representation block) char)) ) -(def: .public equivalence +(def .public equivalence (Equivalence Block) (implementation - (def: (= reference subject) + (def (= reference subject) (and (n.= (..start reference) (..start subject)) (n.= (..end reference) (..end subject)))))) -(def: .public hash +(def .public hash (Hash Block) (implementation - (def: equivalence ..equivalence) - (def: (hash value) + (def equivalence ..equivalence) + (def (hash value) (i64.or (i64.left_shifted 32 (..start value)) (..end value))))) (with_template [<start> <end> <name>] - [(def: .public <name> + [(def .public <name> Block (let [start (hex <start>) end (hex <end>)] |