-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Support scalar encoders when doing custom definitions #109
Comments
Hello @johnhydroware, thank you for reporting the issue! I've implemented a fix for including Encoders in addition to Decoders: #111 However, I'm not sure that it's possible to support arbitrary The design I have with #111 assumes that there is a single data type that is a source of truth for representing something in Elm. It uses that one data type as the target to decode to, and expects it as the values passed in to encode from. For example, you could have a I think this is a reasonable assumption, and it makes things more robust and simple. It seems to me that The reason it's different, I think, comes down to the fact that it's inherently untyped. That's exactly the purpose of Could you give me a little more detail on your use case to help me understand what type of data your sending in as a Thanks! Dillon |
I just shipped NPM version 3.2.0 which includes the changes I described above. Another thought, having the guarantee that the type of the Encoder matches the type of the Decoder adds an extra layer of safety if you use custom types. For example, if you define a decoder that turns something into a Would love to hear your thoughts when you have a chance! |
The generator needs to support custom scalar encoders as well as custom decoders to fully support custom scalar types used in both directions.
The text was updated successfully, but these errors were encountered: