Skip to content

Instantly share code, notes, and snippets.

View pepeiborra's full-sized avatar

Pepe Iborra pepeiborra

View GitHub Profile
@pepeiborra
pepeiborra / idiomaticjsonserialiser.fs
Last active August 8, 2016 17:00 — forked from isaacabraham/idiomaticjsonserialiser.fs
This JSON.Net converter handles F# discriminated unions with slightly more "idiomatic" JSON than what is generated by the current version of JSON .NET. Tuple-style properties are used rather than array notation.
namespace DU.Json
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open Newtonsoft.Json.Serialization
open System
module Exts =
type TokenValue =
{ typ : JsonToken