Created
October 23, 2017 13:45
-
-
Save neilmock/c02b77657badf0e497d2ee2d0da8d5bf 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 merge x y => | |
switch (x, y) { | |
| ([], l) => l | |
| (l, []) => l | |
| ([hx, ...tx], [hy, ...ty]) => | |
if (hx < hy) { | |
[hx, ...merge tx [hy, ...ty]] | |
} else { | |
[hy, ...merge [hx, ...tx] ty] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment