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

Codec.custom and Codec.object: Warning about order being important #21

Open
Janiczek opened this issue Nov 6, 2024 · 0 comments
Open

Comments

@Janiczek
Copy link

Janiczek commented Nov 6, 2024

When first using this library, I have not made the realization that codecs will likely have a similar issue like JSON decoders in that order of fields is important and can't be checked/secured against in compile time.

I've introduced a bug by using codecs wrong - adding a new parameter to the function passed Codec.custom in the 1st position, while adding another |> Codec.variant0 line in a non-1st position.

Might be useful to have a warning / note about order still being important in Codec.custom and Codec.object and what bugs can happen when you mix those up.

And perhaps about Codec.enum existing. There will be people like me whose first encounter with elm-codec is via elm-review-derive which doesn't do Codec.enum

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

No branches or pull requests

1 participant