Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kjellski
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjellski/2a25cc0c584b709f17e7 to your computer and use it in GitHub Desktop.
Save kjellski/2a25cc0c584b709f17e7 to your computer and use it in GitHub Desktop.
compress
let rec compress = function
| a :: b :: xss ->
if a = b then compress(b::xss) else a:: compress(b::xss)
| smaller -> smaller
let list = ["a";"a";"a";"a";"b";"c";"c";"a";"a";"d";"e";"e";"e";"e"]
string list
compress list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment