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] --- .../source/library/lux/data/text/unicode/block.lux | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'stdlib/source/library/lux/data/text/unicode/block.lux') 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 [ ] - [(def: .public + [(def .public (-> Block Char) (|>> representation (the )))] @@ -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 [ ] - [(def: .public + [(def .public Block (let [start (hex ) end (hex )] -- cgit v1.2.3