Created
July 16, 2019 12:54
-
-
Save Leonidas-from-XIV/0e9469449458c906cf3ce1711ab3283d to your computer and use it in GitHub Desktop.
Quick and dirty, non-TR list_set_exn
This file contains 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
open Core | |
let rec list_set_exn index v = function | |
| [] -> [] | |
| _ :: xs when index = 0 -> v :: xs | |
| x :: xs -> x :: list_set_exn (Int.pred index) v xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment