Skip to content

Commit

Permalink
fix Trait.Ord
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 5, 2023
1 parent 93f2f35 commit 02a155b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Stdlib/Data/Int/Ord.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ syntax operator >= comparison;
>= (m n : Int) : Bool := n <= m;

--- Tests for ;Ordering;.
{-# inline: true #-}
compare (m n : Int) : Ordering :=
if (m == n) EQ (if (m < n) LT GT);

Expand Down
1 change: 1 addition & 0 deletions Stdlib/Data/Nat/Ord.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ syntax operator >= comparison;
>= (n m : Nat) : Bool := m <= n;

--- Tests for ;Ordering;.
{-# inline: true #-}
compare (n m : Nat) : Ordering :=
if (n == m) EQ (if (n < m) LT GT);

Expand Down
4 changes: 2 additions & 2 deletions Stdlib/Trait/Ord.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ syntax operator < comparison;
--- Returns ;true; iff the first element is less than the second.
< {A} {{Ord A}} (x y : A) : Bool :=
case Ord.cmp x y of {
| EQ := true
| LT := false
| EQ := false
| LT := true
| GT := false
};

Expand Down

0 comments on commit 02a155b

Please sign in to comment.