Created
March 2, 2017 04:42
-
-
Save ccorcos/112496bcb6e1cdd53a2f90c56d623335 to your computer and use it in GitHub Desktop.
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
const not = parser => | |
new Parser(stream => | |
parser.run(stream) | |
.fold( | |
(value, s) => new Failure('not failed', stream), | |
(value, s) => | |
stream.length > 0 | |
? new Success(stream.head(), stream.move(1)) | |
: new Failure('unexpected end', stream))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment