Skip to content

Instantly share code, notes, and snippets.

@caindy
Created December 5, 2015 18:13
Show Gist options
  • Save caindy/24e15d24621d31dec3a9 to your computer and use it in GitHub Desktop.
Save caindy/24e15d24621d31dec3a9 to your computer and use it in GitHub Desktop.
Using the special (?) F# operator to streamline the Fleece monadic syntax
(*
let shareMsgParser = fun j -> jsonParse {
let! shareWith = j?users
return Share shareWith }
*)
let inline (?) (j : JsonValue) (k : string) =
match j with
| JObject props -> jget props k
| _ -> Failure <| sprintf "%s not found in %A" k j
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment