Created
October 11, 2017 08:59
-
-
Save orient-man/baba3f65abedf7bc91a74076e86733f2 to your computer and use it in GitHub Desktop.
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 Input = A of int | B of int | C of int | |
type Output = { A: int; B: int; C: int; Text: string } | |
seq { | |
yield (A 5, B 10), "text 1" | |
yield (B 5, C 10), "text 2" | |
yield (A 5, C 10), "text 3" | |
} | |
|> Seq.map (function | |
| (A a, B b), text -> { A = a; B = b; C = a * b; Text = text } | |
| (B b, C c), text -> { A = b * c; B = b; C = c; Text = text } | |
| (A a, C c), text -> { A = a; B = a * c; C = c; Text = text } | |
| _ -> failwith "invalid input") | |
|> List.ofSeq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment