Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MINIMAL pragma to ord #6657

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plutus-benchmark/nofib/src/PlutusBenchmark/NoFib/Queens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ instance TxPrelude.Eq Assign
where (a := b) == (a' := b') = a==a' && b==b'
instance TxPrelude.Ord Assign
where (a := b) < (a' := b') = (a<a') || (a==a' && b < b')
(a := b) <= (a' := b') = (a<a') || (a==a' && b <= b')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwxm do you remember anything about the nofib implementation? Is it fine to make this change here? Should we just disable the warning not allowing us to make this change?


type Relation = Assign -> Assign -> Bool

Expand Down
1 change: 1 addition & 0 deletions plutus-tx/src/PlutusTx/Ord.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class Eq a => Ord a where
max x y = if x <= y then y else x
{-# INLINABLE min #-}
min x y = if x <= y then x else y
{-# MINIMAL compare | (<=) #-}
aleeusgr marked this conversation as resolved.
Show resolved Hide resolved

instance Eq Ordering where
{-# INLINABLE (==) #-}
Expand Down