-
Notifications
You must be signed in to change notification settings - Fork 6
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
F# support #36
Comments
Or maybe: Generated:module Person
let serializeWith (serializeFn: Serde.ISerialize -> string) (person: Person) =
{ new Serde.ISerialize with
member this.Serialize(serializer: ISerializer) =
let type = serializer.SerializeType("Person", 2)
type.SerializeField("Name", StringWrap(person.Name))
type.SerializeField("Age", Int32Wrap(person.Age))
type.End()
}
|> serializeFn Usage:{ Name = "John"; Age = 100 }
|> Person.serializeWith (JsonSerializer.Serialize)
|> printfn "%s" |
as an interim, maybe look at Chiron's combinator-based model and have a Chiron 'backend' for |
This issue was kind of DoA, but now I'm curious.
EDIT: It just occurred to me that you were suggesting Chiron as an already-existing alternative. |
FWIW I'm still thinking about this and exactly how to implement it. The main hold-up is that I'm still iterating a bit on the Serde API itself. For example, right now So I think I might make |
After playing around with the C# implementation, I was thinking about what an F# implementation might look like using Myriad:
C#
F#
Generated:
Usage:
It wouldn't be quite as user friendly as the C# generator version because:
The text was updated successfully, but these errors were encountered: