mlabs-haskell / mlabs-haskell/lambda-buffers

JSon instances for Map/Set require Ord constraint

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

Nobody has claimed this yet.

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

Description

https://github.com/mlabs-haskell/lambda-buffers/blob/f5acbc09718191cdfbf374ee5aaeacf626b8b9e9/runtimes/haskell/lbr-prelude/src/LambdaBuffers/Runtime/Prelude/Json.hs#L140

sum X = Y | Z
derive Json X

record Test  = {
  test : Map X Integer
}
derive Json Test

The generated code will break because X doesn't have Ord.

See #224

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 in runtimes/haskell/lbr-prelude/src/LambdaBuffers/Runtime/Prelude/Json.hs around line 140, and compare the behavior with issue #224. Reproduce the schema using Map X Integer and derive Json, then inspect the generated Haskell code. Done means the example compiles without requiring an Ord constraint on X.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.