Skip to content

Conversation

@illusionalsagacity
Copy link
Contributor

Fixes #105

Generic types with multiple type parameters generated codec functions
with incorrect arity, causing each codec parameter to be curried
separately instead of grouped as an uncurried tuple.

  • Refactored add_encoder_params and add_decoder_params to use
    List.fold_right and set the outer function arity to the total
    number of type parameters
  • Refactored add_params to count parameters and set correct arity

illusionalsagacity and others added 3 commits January 24, 2026 18:10
Fixes mununki#105

Generic types with multiple type parameters generated codec functions
with incorrect arity, causing each codec parameter to be curried
separately instead of grouped as an uncurried tuple.

- Refactored `add_encoder_params` and `add_decoder_params` to use
  `List.fold_right` and set the outer function arity to the total
  number of type parameters
- Refactored `add_params` to count parameters and set correct arity

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Records: t5<'data>, t6<'key, 'value>
- Variants: t5<'a>, t6<'a, 'b>
- Polyvariants: t3<'a>, t4<'a, 'b>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Parametrized types / generics not working

1 participant