From 547f843c54e9df235342925f5fe8dd4eaa7f06b1 Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 2 Jan 2024 10:16:04 -0500 Subject: [PATCH] Correct `Neg` instances --- packages/rose/src/num.rose | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/rose/src/num.rose b/packages/rose/src/num.rose index b8ac26d..5913b58 100644 --- a/packages/rose/src/num.rose +++ b/packages/rose/src/num.rose @@ -37,7 +37,7 @@ pub infixl [1] A B (Div A B) => (x : A) / (y : B) : (Div A B).T = Div.div x y instance Neg i32 { type T = i32 - def neg = i32.neg + def neg (x : i32) : i32 = i32.sub 0 x } instance Add i32 i32 { @@ -62,11 +62,6 @@ instance Div i32 i32 { # u32 -instance Neg u32 { - type T = u32 - def neg = u32.neg -} - instance Add u32 u32 { type T = u32 def add = u32.add @@ -91,7 +86,7 @@ instance Div u32 u32 { instance Neg i64 { type T = i64 - def neg = i64.neg + def neg (x : i64) : i64 = i64.sub 0 x } instance Add i64 i64 { @@ -116,11 +111,6 @@ instance Div i64 i64 { # u64 -instance Neg u64 { - type T = u64 - def neg = u64.neg -} - instance Add u64 u64 { type T = u64 def add = u64.add