Skip to content

Commit

Permalink
Correct Neg instances
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Jan 2, 2024
1 parent c7f6e58 commit 547f843
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/rose/src/num.rose
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 547f843

Please sign in to comment.