Skip to content

Instantly share code, notes, and snippets.

@loicdescotte
Created January 31, 2019 15:46
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 loicdescotte/96979aa6c8c92a264c8c5faeaa25b37e to your computer and use it in GitHub Desktop.
Save loicdescotte/96979aa6c8c92a264c8c5faeaa25b37e to your computer and use it in GitHub Desktop.
ReasonML : drop element in list
let dropListElement = (n, list) => {
let rec aux = (i, list) =>
switch list {
| [] => []
| [x, ...xs] => i == n ? xs : [x, ...aux(i + 1, xs)]
};
aux(0, list);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment