Skip to content

Instantly share code, notes, and snippets.

@wegry
Created July 26, 2018 09:02
Show Gist options
  • Save wegry/19b56a506b12b8e865f2e2cadc8e38e1 to your computer and use it in GitHub Desktop.
Save wegry/19b56a506b12b8e865f2e2cadc8e38e1 to your computer and use it in GitHub Desktop.
let range: (int, int) => array(int) = [%bs.raw
(a, b) => {j|
const ranger = {};
ranger[Symbol.iterator] = function* () {
let current = a;
while (a <= b) {
yield a++;
}
}
return [...ranger];
|j}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment