Last active
August 29, 2015 14:14
-
-
Save mat3u/ca8eed1f1ae831ef0a9a 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
let rec unzip3<'a, 'b, 'c> ((A: 'a list), (B: 'b list), (C: 'c list)) (tuples: (('a * 'b * 'c) list)) : ('a list) * ('b list) * ('c list) = | |
match tuples with | |
| (a: 'a, b: 'b, c: 'c)::tail -> unzip3 (a ++ A, b ++ B, c ++ C) tail | |
| [] -> (A, B, C) | |
let rec unzip3 (A, B, C) tuples = | |
match tuples with | |
| (a: 'a, b: 'b, c: 'c)::tail -> unzip3 (a :: A, b :: B, c :: C) tail | |
| [] -> (A, B, C) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment