How to use the parser-ts.stream.stream function in parser-ts

To help you get started, we’ve selected a few parser-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gcanti / fp-ts-codegen / test / haskell.ts View on Github external
const assertSuccess = <a>(parser: parser.Parser, input: string, expected: A) =&gt; {
  const result = parser(stream.stream(input.split('')))
  if (isRight(result)) {
    assert.deepStrictEqual(result.right.value, expected)
  } else {
    throw new Error(`${result} is not a right`)
  }
}
</a>