Function map

  • map is a parser combinator that takes a parser and a mapper function. If the parser succeeds, it maps its result using the mapper function. You can think of map as a general map, like for functors, applied to a parser. Since map itself is a parser, you can use it in seq or other combinators.

    Type Parameters

    Parameters

    • parser: GeneralParser<R, C>

      parser to run

    • mapperFunc: ((x) => X)

      function to map the result of the parser

        • (x): X
        • Parameters

          • x: R

          Returns X

    Returns GeneralParser<X, C>

Generated using TypeDoc