Skip to content

Instantly share code, notes, and snippets.

@alecbz
Created December 2, 2010 22:12
Show Gist options
  • Save alecbz/726188 to your computer and use it in GitHub Desktop.
Save alecbz/726188 to your computer and use it in GitHub Desktop.
merge :: (Ord a) => [a] -> [a] -> [a]
merge [] y = y
merge x [] = x
merge xxs@(x:xs) yys@(y:ys)
| x < y = x : merge xs yys
| otherwise = y : merge xxs ys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment