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

Drop Ord instances for ExUnits. #2222

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Drop Ord instances for ExUnits. #2222

merged 1 commit into from
Apr 8, 2021

Conversation

TimSheard
Copy link
Contributor

Addresses CAD 2929

The Ord instance for ExUnits is problematic, since when we want to compare
if one ExUnits is less than another we want the partial pointwise ordering,
not the lexigraphic ordering one gets when deriving Ord.

  1. we drop the Ord instance for ExUnits
  2. We provide a pointwise comparision pointWiseExUnits
  3. We replace calls of (ex1 <= ex2) with (pointWiseExUnits (<=) ex1 ex2)
  4. We roll an Ord instance of (PParams StrictMaybe era) by hand since its
    needs a lexographic ordering in ExUnits.

The Ord instance for ExUnits is problematic, since when we want to compare
if one ExUnits is less than anther we want the partial pointwise ordering,
not the lexigraphic ordering one gets when deriving Ord. Addresses CAD 2929

1) we drop the Ord instance for ExUnits
2) We provide a pointwise comparision pointWiseExUnits
3) We replace calls of (ex1 <= ex2) with (pointWiseExUnits (<=) ex1 ex2)
4) We roll an Ord instance of (PParams StrictMaybe era) by hand since its
   needs a lexographic ordering in ExUnits.
@TimSheard TimSheard requested a review from nc6 April 7, 2021 16:51
@nc6 nc6 merged commit 0a7052a into master Apr 8, 2021
@iohk-bors iohk-bors bot deleted the ts-dropOrd-ExUnits branch April 8, 2021 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants