Skip to content

Instantly share code, notes, and snippets.

@vasily-kirichenko
Created July 3, 2017 13:52
Show Gist options
  • Save vasily-kirichenko/4a34869ff6453978fdd91b89114bb22d to your computer and use it in GitHub Desktop.
Save vasily-kirichenko/4a34869ff6453978fdd91b89114bb22d to your computer and use it in GitHub Desktop.
type A = { a1: int; a2: int; a3: int }
type B = { b1: int; b2: int; b3: int }
type C = { c1: int; c2: int; c3: int }
type T =
static member M(?a1: int, ?a2: int, ?a3: int,
?b1: int, ?b2: int, ?b3: int,
?c1: int, ?c2: int, ?c3: int) = ()
let a: A option = None
let b: B option = None
let c: C option = None
T.M(
?a1 = (a |> Option.map (fun x -> x.a1)),
?a2 = (a |> Option.map (fun x -> x.a2)),
?a3 = (a |> Option.map (fun x -> x.a3)),
?b1 = (b |> Option.map (fun x -> x.b1)),
?b2 = (b |> Option.map (fun x -> x.b2)),
?b3 = (b |> Option.map (fun x -> x.b3)),
?c1 = (c |> Option.map (fun x -> x.c1)),
?c2 = (c |> Option.map (fun x -> x.c2)),
?c3 = (c |> Option.map (fun x -> x.c3)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment