Created
October 12, 2016 09:49
-
-
Save kolektiv/c7674a9ee26bc7f34b3c98203b664d58 to your computer and use it in GitHub Desktop.
Serialize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Address = | |
{ Street: string | |
Number: int } | |
static member ToJson (x: Address) = | |
json { | |
do! Json.write "street" x.Street | |
do! Json.write "streetNumber" x.Number } | |
type House = | |
{ Inhabitant: string | |
Address: Address } | |
static member ToJson (x: House) = | |
json { | |
do! Json.write "inhabitant" x.Inhabitant | |
do! Json.write "address" x.Address } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment