MCPcopy Index your code
hub / github.com/Effect-TS/effect / parserFlatMap

Function parserFlatMap

packages/printer/src/internal/docTree.ts:384–385  ·  view source on GitHub ↗
(self: DocTreeParser<S, A>, f: (a: A) => DocTreeParser<S, B>)

Source from the content-addressed store, hash-verified

382
383const parserFlatMap =
384 <S, A, B>(self: DocTreeParser<S, A>, f: (a: A) => DocTreeParser<S, B>): DocTreeParser<S, B> => (stream) =>
385 Option.flatMap(self(stream), ([a, s1]) => f(a)(s1))
386
387function many<S, A>(parser: DocTreeParser<S, A>): DocTreeParser<S, ReadonlyArray<A>> {
388 return (stream) =>

Callers 1

treeFunction · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected