Skip to content
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

Question: is this library usable from C#? #69

Open
knocte opened this issue Mar 21, 2020 · 4 comments
Open

Question: is this library usable from C#? #69

knocte opened this issue Mar 21, 2020 · 4 comments

Comments

@knocte
Copy link

knocte commented Mar 21, 2020

No description provided.

@gusty
Copy link
Member

gusty commented Mar 21, 2020

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 or JsonEncode.dictionary, see in the source modules JsonEncode and JsonDecode for more information.

Don't forget give us feedback !

@knocte
Copy link
Author

knocte commented Mar 21, 2020

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?

@wallymathieu
Copy link
Member

I think that sounds like different use case than what Fleece is supposed to solve?

@gusty
Copy link
Member

gusty commented Mar 21, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants