-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
DerivingVia for Generic table codecs #272
Labels
Milestone
Comments
chshersh
added
codec
Conversion between TOML and custom user data types
generics
Generic bidirectional codecs
labels
May 15, 2020
Currently, I am getting • Couldn't match type ‘TomlTable Address’ with ‘Address’
arising from the coercion of the method ‘hasCodec’
from type ‘Toml.Key -> TomlCodec (TomlTable Address)’
to type ‘Toml.Key -> TomlCodec Address’
• When deriving the instance for (HasCodec Address)
|
182 | deriving HasCodec via (TomlTable Address)
| With the example from docs. I don't really know how to solve this issue. Do you have any ideas, @chshersh ? |
vrom911
added a commit
that referenced
this issue
May 15, 2020
@vrom911 Ah, sh*t, here we go again. The error is different, but it doesn't tell me how to solve the issue. Well, I guess not in this release... |
Should be possible to do after #311 🙂 |
vrom911
added a commit
that referenced
this issue
May 19, 2020
vrom911
added a commit
that referenced
this issue
May 19, 2020
chshersh
pushed a commit
that referenced
this issue
May 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've tried to use fancy tricks for table codecs with generics. You can find my commented code here:
tomland/src/Toml/Codec/Generic.hs
Lines 406 to 449 in 536a5e6
It wasn't possible to implement this feature back then. But thanks to @vrom911 nice work on simplifying the
Codec
type, I think we should be able to implement that feature again.The text was updated successfully, but these errors were encountered: