IntersectMBO / plutus

The Plutus language implementation and tools
Apache License 2.0
1.55k stars 466 forks source link

Add a `MINIMAL` pragma to `Ord` and check existence of other `MINIMAL` pragmas #6270

Open effectfully opened 4 days ago

effectfully commented 4 days ago

PlutusTx.Ord.Ord lacks a MINIMAL pragma meaning it's easy to cause an infinite loop by defining an instance of this class. We should simply take the pragma from base (where that code is stolen from):

{-# MINIMAL compare | (<=) #-}

and check existence of MINIMAL pragmas for all the other type classes where such a pragma applies.