Skip to content

Conversation

thomasjm
Copy link
Contributor

@thomasjm thomasjm commented Aug 1, 2025

Fixes #51.

After b02479d, it turned out there were still issues because a single Maybe a in a tuple encoding was handled differently from one with two or more fields. To address this, we have to make the actual tuple instances themselves understand the getTypeScriptOptional stuff.

This PR

  • Adds TH to derive suitable tuple instances from size 2 to 10
  • Adds some handwritten tests in test/MaybeTyples.hs
  • Adds both a size-1 and size-2 tuple encoding to the examples we test in TestBoilerplate.hs.

CC @kallevmercury

Copy link

@kallevmercury kallevmercury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I tested against the issue in #51 and this PR seems to resolve it.

@thomasjm thomasjm merged commit 846f4de into master Aug 1, 2025
44 checks passed
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.

Maybe NonEmpty types in a multi-field tuple do not generate the expected null / undefined values in corresponding Typescript list
2 participants