aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/number/i64.lux37
1 files changed, 22 insertions, 15 deletions
diff --git a/stdlib/source/lux/data/number/i64.lux b/stdlib/source/lux/data/number/i64.lux
index dbc58b004..15b4ed821 100644
--- a/stdlib/source/lux/data/number/i64.lux
+++ b/stdlib/source/lux/data/number/i64.lux
@@ -1,7 +1,8 @@
(.module:
[lux (#- and or not)
[abstract
- [monoid (#+ Monoid)]]])
+ [monoid (#+ Monoid)]
+ [equivalence (#+ Equivalence)]]])
(def: #export bits-per-byte 8)
@@ -32,20 +33,6 @@
(All [s] (-> (I64 s) (I64 s)))
(xor (:coerce I64 -1)))
-(structure: #export disjunction
- (All [a] (Monoid (I64 a)))
-
- (def: identity (.i64 0))
- (def: compose ..or)
- )
-
-(structure: #export conjunction
- (All [a] (Monoid (I64 a)))
-
- (def: identity (.i64 (..not 0)))
- (def: compose ..and)
- )
-
(def: #export (mask bits)
(-> Nat (I64 Any))
(|> 1 (..left-shift (n/% ..width bits)) .dec))
@@ -105,3 +92,23 @@
(def: #export (region size offset)
(-> Nat Nat I64)
(|> 1 (:coerce I64) (left-shift size) dec (left-shift offset)))
+
+(structure: #export equivalence
+ (All [a] (Equivalence (I64 a)))
+
+ (def: (= parameter subject)
+ ("lux i64 =" parameter subject)))
+
+(structure: #export disjunction
+ (All [a] (Monoid (I64 a)))
+
+ (def: identity (.i64 0))
+ (def: compose ..or)
+ )
+
+(structure: #export conjunction
+ (All [a] (Monoid (I64 a)))
+
+ (def: identity (.i64 (..not 0)))
+ (def: compose ..and)
+ )