Skip to content

Instantly share code, notes, and snippets.

@jchavarri
Created September 29, 2017 23:34
Show Gist options
  • Save jchavarri/0271d2a8df992c5267943dd74589d1cc to your computer and use it in GitHub Desktop.
Save jchavarri/0271d2a8df992c5267943dd74589d1cc to your computer and use it in GitHub Desktop.
A small util to split a string in an array of chars
let explode s => {
let rec exp i l =>
if (i < 0) {
l
} else {
exp (i - 1) [s.[i], ...l]
};
exp (String.length s - 1) []
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment