Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/lambdapi/src/deps.ts>seqMap

Deno TypeScript implementation of LambdaPi interpreter from "A Tutorial Implementation of a Dependently Typed Lambda Calculus" https://www.andres-loeh.de/LambdaPi/
Latest
function seqMap
import { seqMap } from "https://deno.land/x/lambdapi@v1.0.1/src/deps.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>