Closed neongreen closed 7 years ago
I think you found a bug! I always intended to use objects, and the toEncoding function seems to do the right thing. It looks like the recToValue
( https://github.com/agrafix/superrecord/blob/e19cf6f5d319aa9a15c1068a33ff3a417dab939a/src/SuperRecord.hs#L596-L597 ) functions does not match the recToEncoding
function. Would you like to write a test and fix this bug?
Sure!
Expect a PR today.
awesome, thank you!
Currently records are converted into arrays of pairs:
Perhaps it would be better to convert them to objects instead? I understand that it would make conversions lossy if there are two fields with the same name, but I'm not sure how common that usecase it (in the worst case we could keep current
recToVal
under a different name, so that if somebody really needed it, they could use it).