Open knocte opened 4 years ago
Thanks; but looking at the docs more deeply I'm not sure Fleece meets my needs, as I was looking for something more "automatic" that let me not need to hardcode strings (still with no reflection usage) e.g. like the auto-coders of Thoth https://thoth-org.github.io/Thoth.Json/#Auto-coders , is there anything like this in Fleece?
I think that sounds like different use case than what Fleece is supposed to solve?
Well, I think those auto-coders do use reflection, or maybe another technique but also at run-time.
Fleece is automatic for known types, for the rest you have to describe (with functions) what do you want. That's why it's a Json mapper.
We might consider adding auto-coders at some stage, provided that there's always a way to opt-out from them so we don't lose compile-time guarantees.
I personally never tried, nor considered that possibility.
It would be interesting to hear what other authors and users say about this.
Anyway, for sure all the SRTP functionality won't work from C#, but passing explicitly the encoder / decoder combinator should work and signatures are not that specific to F#, except the Result type.
Advanced use of codecs, avoiding SRTPs by passing explicitly the codec combinator should work in theory from C# but the signatures would be too complicated to handle from C# I think.
See the section https://github.com/mausch/Fleece#combinators there are some examples that might be possible to code from C#
Regarding the former (decoder and encoder combinators) they are readyo use, stuff like:
JsonDecode.array
orJsonEncode.dictionary
, see in the source modules JsonEncode and JsonDecode for more information.Don't forget give us feedback !