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

Ord type class #224

Open
8 tasks
bladyjoker opened this issue Jun 7, 2024 · 0 comments
Open
8 tasks

Ord type class #224

bladyjoker opened this issue Jun 7, 2024 · 0 comments

Comments

@bladyjoker
Copy link
Contributor

This is sorely needed and the absence of this is making containers relying on order of values to be barely useful (one needs to pass around orphan instance implementations).

TODO:

  • Research: Prelude opaque types ordering among supported languages (for example: How is Ord Text in Haskell vs Rust vs Typescript vs Purescript, does the order match? if "b" > "a" in one language, it has to be the same in all others). How do we proceed if for example Rust and Haskell implement different ordering for Text?
  • Research: Plutus opaque types ordering.
  • Research: Specify how ordering is derived for transparent types. How does that impact Plutarc/PlutusTx backends? Can we rely on the ordering of the underlying PlutusData value representations?
  • Design and implement tests
    • I imagine an lb.json file that contains a List a where a is some orderable. The golden file would contain elements in correct order and the testsuite would read golden >> permutate >> order >> compare.
    • Otherwise, internal tests for each backend would also do property testing on a > b && b > c => a > c etc.
  • Implement Haskell, Purescript, Rust, Typescript, PlutusTx and Plutarch backends
    • Because of how the codegen framework works, theoretically this should 'just' require the LamVal spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant