Created
September 29, 2017 23:34
-
-
Save jchavarri/0271d2a8df992c5267943dd74589d1cc to your computer and use it in GitHub Desktop.
A small util to split a string in an array of chars
This file contains hidden or 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 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