Skip to main content
Module

x/applicative_parser/parser.ts>seqMap

parser combinators applicative TypeScript deno module
Latest
function seqMap
import { seqMap } from "https://deno.land/x/applicative_parser@1.0.23/parser.ts";

seqMap accepts a map function as the first argument, and then the remaining arguments are parsers. If all the parsers succeed, the map function is called with the result of each parser as an argument to the map function in the same order as the parsers.

This is used to implement the common pattern of calling a map function to construct an abstract syntax tree node with the results of several parsers that must all succeed, where each parser can return a different type.

Type Parameters

A
T extends Parser<any, any>[]

Parameters

map: (..._: [...UnwrapParsers<T>]) => A
...parsers: T

Returns

Parser<UnwrapArg<T>, A>