Skip to content

Instantly share code, notes, and snippets.

@alieniasty
Created March 26, 2019 11:27
Show Gist options
  • Save alieniasty/738007a986bccb36d2c627e24362c62d to your computer and use it in GitHub Desktop.
Save alieniasty/738007a986bccb36d2c627e24362c62d to your computer and use it in GitHub Desktop.
*Given [2] to h::t. Head is 2, tail i empty list.
let revR list =
let rec shift acc tail =
match tail with
| [] -> acc
| h::t -> shift ([h] @ acc) t
shift [] list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment