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
| (menhir | |
| (modules parser)) | |
| (ocamllex lexer) | |
| (executable | |
| (name ex)) |
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 partition_by_identity = xs => { | |
| let rec impl = (xs, cur) => { | |
| switch (xs, cur) { | |
| | ([], _) => [cur] | |
| | ([x, ...xs], []) => impl(xs, [x]) | |
| | ([x, ...xs], [y, ..._]) => | |
| if (x == y) { | |
| impl(xs, [x, ...cur]); | |
| } else { | |
| [cur, ...impl(xs, [x])]; |
OlderNewer