fsprojects / Fleece

Json mapper for F#
http://fsprojects.github.io/Fleece
Apache License 2.0
199 stars 31 forks source link

Fix problem with long tuples #121

Closed gusty closed 2 years ago

gusty commented 2 years ago

I added a failing test as first commit to demonstrate the problem, which reveals a little flaw in the current design.

Long story short, we shouldn't decode while encoding and the other way around, and we should treat types that encode to array-likes as codecs to 'Encoding [] pretty much the same way we treat dictionaries-like as PropertyList<'Encoding>.

This new iteration in the design affect a bit the error DU and as seen in the legacy version of count it proves we're on the right track, as it becomes type safer.

It also reduce the amount of methods in the interface, by assuming tuples (and unit) will encode in an array-like way.