Last active
December 19, 2015 23:19
-
-
Save davidgrenier/6034357 to your computer and use it in GitHub Desktop.
Transpose3 inspired by: http://bugsquash.blogspot.ca/2013/06/optimizing-with-help-of-fscheck.html
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 transpose3 = function | |
| [||] -> [||] | |
| a -> | |
Array.maxBy Array.length a | |
|> Array.Parallel.mapi (fun i _ -> | |
Array.filter (fun js -> Array.length js > i) a | |
|> Array.map (fun sub -> sub.[i]) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment