This is used to generate a return type for the many and
many1 combinators. Given a parser we want to apply
many to. Suppose its type is
Parser<string>. This will return
Parser<string[]> as the return type.
Suppose the parser is a
CaptureParser<string, { name: string }>. This
will return
CaptureParser<string[], { captures: { name: string }[]
}>
as the return type.
This is used to generate a return type for the
many
andmany1
combinators. Given a parser we want to applymany
to. Suppose its type isParser<string>
. This will returnParser<string[]>
as the return type.Suppose the parser is a
CaptureParser<string, { name: string }>
. This will returnCaptureParser<string[], { captures: { name: string }[] }>
as the return type.