mlabs-haskell / mlabs-haskell/lambda-buffers

Ord type class

Open
#224 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
32
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the LamVal spec and the existing Haskell, Purescript, Rust, Typescript, PlutusTx, and Plutarch backend structure. Review the proposed lb.json and golden-file tests, then clarify ordering semantics for opaque and transparent types before implementing the Ord type class and backend coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell, rust, typescript
Domain
compilers, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.