Closed jhrcek closed 1 year ago
Thanks, docs updated.
Is anything blocking merge of this?
We didn't get any feedback from @silky who actually requested that change. Let me revisit this PR and make it mergeable within the next few days if we don't hear from him.
Apologies for never getting around to responding to this; in the end I changed jobs since I needed it :)
But at a glance, it definitely does what I wanted, and I'll probably have cause to use it again at some point in the future; so that's great! Thanks :) 🙏🏻
I'm playing with ways that would allow resolving https://github.com/Holmusk/elm-street/issues/129 while keeping the old behavior (stripping type name prefix) by default.
The important thing is that generated Elm encoders and decoders have to be compatible with ToJSON / FromJSON instances of Haskell types used across Haskell + Elm. This means that both Elm instance and ToJSON / FromJSON must use the same (what I call)
CodeGenSettings
that carry the "field label modifier" function (which for now is the only aspect of code generation that we allow to override).See Type.hs for an example of how this could be used.
I'll need to think if this could be done more nicely over the next few days, but feel free to provide feedback if any.