How to use the parser-ts.parser.apSecond 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 / src / haskell.ts View on Github external
P.chain(name =>
    pipe(
      S.fold([S.spaces, S.string('::'), S.spaces]),
      P.apSecond(type),
      P.map(type => ({ name, type }))
    )
  )
github gcanti / fp-ts-codegen / src / haskell.ts View on Github external
const withParens = <a>(parser: P.Parser): P.Parser =&gt; {
  return pipe(
    leftParens,
    P.apSecond(parser),
    P.apFirst(rightParens)
  )
}
</a>
github gcanti / fp-ts-codegen / src / haskell.ts View on Github external
P.chain(name =>
    pipe(
      S.spaces,
      P.apSecond(
        pipe(
          types,
          P.map(parameters => M.ref(name, parameters))
        )
      )
    )
  )
github gcanti / fp-ts-codegen / src / haskell.ts View on Github external
P.chain(domain =>
          pipe(
            arrow,
            P.apSecond(type),
            P.map(codomain => M.fun(domain, codomain))
          )
        )