-
Notifications
You must be signed in to change notification settings - Fork 479
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
base: master
Are you sure you want to change the base?
add MINIMAL
pragma to ord
#6657
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
00a2746
to
9a49bec
Compare
output
src/PlutusTx/Applicative.hs:class Functor f => Applicative f where
src/PlutusTx/Blueprint/Class.hs:class HasBlueprintSchema (t :: Type) (referencedTypes :: [Type]) where
src/PlutusTx/Blueprint/Definition/Derive.hs:class DefinitionsFor' referencedTypes acc where
src/PlutusTx/Blueprint/Definition/Unroll.hs:class HasBlueprintDefinition (t :: Type) where
src/PlutusTx/Builtins/HasBuiltin.hs:class PLC.DefaultUni `PLC.Contains` a => HasToBuiltin a where
src/PlutusTx/Builtins/HasBuiltin.hs:class HasToBuiltin (FromBuiltin arep) => HasFromBuiltin arep where
src/PlutusTx/Builtins/HasOpaque.hs:class HasToOpaque a arep | a -> arep where
src/PlutusTx/Builtins/HasOpaque.hs:class HasFromOpaque arep a | arep -> a where
src/PlutusTx/Builtins/HasOpaque.hs:class MkNil arep where
src/PlutusTx/Enum.hs:class Enum a where
src/PlutusTx/Eq.hs:class Eq a where
src/PlutusTx/Foldable.hs:class Foldable t where
src/PlutusTx/Functor.hs:class Functor f where
src/PlutusTx/IsData/Class.hs:class ToData (a :: Type) where
src/PlutusTx/IsData/Class.hs:class FromData (a :: Type) where
src/PlutusTx/IsData/Class.hs:class UnsafeFromData (a :: Type) where
src/PlutusTx/Lattice.hs:class JoinSemiLattice a where
src/PlutusTx/Lattice.hs:class MeetSemiLattice a where
src/PlutusTx/Lattice.hs:class JoinSemiLattice a => BoundedJoinSemiLattice a where
src/PlutusTx/Lattice.hs:class MeetSemiLattice a => BoundedMeetSemiLattice a where
src/PlutusTx/Lift/Class.hs:class Typeable uni (a :: k) where
src/PlutusTx/Lift/Class.hs:class Lift uni a where
src/PlutusTx/Monoid.hs:class Semigroup a => Monoid a where
src/PlutusTx/Monoid.hs:class Monoid a => Group a where
src/PlutusTx/Numeric.hs:class AdditiveSemigroup a where
src/PlutusTx/Numeric.hs:class AdditiveSemigroup a => AdditiveMonoid a where
src/PlutusTx/Numeric.hs:class AdditiveMonoid a => AdditiveGroup a where
src/PlutusTx/Numeric.hs:class MultiplicativeSemigroup a where
src/PlutusTx/Numeric.hs:class MultiplicativeSemigroup a => MultiplicativeMonoid a where
src/PlutusTx/Numeric.hs:class (Ring s, AdditiveGroup v) => Module s v | v -> s where
src/PlutusTx/Ord.hs:class Eq a => Ord a where
src/PlutusTx/Semigroup.hs:class Semigroup a where
src/PlutusTx/Show/TH.hs:class Show a where
src/PlutusTx/Traversable.hs:class (Functor t, Foldable t) => Traversable t where
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's wait for Kenneth to respond and then we'll either ignore the warning in the nofib
file or keep your change.
@@ -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') |
There was a problem hiding this comment.
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?
Thanks for the list of the classes! I'll review it myself, that won't block the PR. |
9a49bec
to
80b8a5a
Compare
Signed-off-by: Alex <alexeusgr@gmail.com>
Signed-off-by: Alex <alexeusgr@gmail.com>
80b8a5a
to
42818a1
Compare
addresses #6270
PlutusTx.Ord
git grep -e "^class .* where" -- **/*.hs
Background
Ord
is a type class that defines a total ordering for types.A pragma is a special instruction or directive that provides additional information to the compiler, allowing for optimizations or modifications in how the code is processed. Pragmas are denoted by the syntax
{-# ... #-}
, and they do not generally affect the semantic meaning of the program, but they can influence performance and behavior during compilation.the
MINIMAL
pragma is used to specify the minimal complete definition of a type class, indicating which methods must be implemented for an instance of that class. This is particularly useful for classes that have methods with circular defaults, ensuring that instances adhere to a defined interface.https://downloads.haskell.org/~ghc/7.8.1/docs/html/users_guide/pragmas.html
base
Checklist
Pre-submit checklist: