Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
P.chain(() =>
pipe(
ref,
P.alt(() => tuple),
P.chain(domain =>
pipe(
arrow,
P.apSecond(type),
P.map(codomain => M.fun(domain, codomain))
)
)
)
)
P.chain(name =>
pipe(
S.spaces,
P.apSecond(P.sepBy(S.spaces, parameterDeclaration)),
P.apFirst(equal),
P.chain(typeParameters =>
pipe(
P.sepBy1(pipeParser, constructor),
P.map(constructors => M.data(name, typeParameters, constructors)),
P.apFirst(S.spaces),
P.apFirst(P.eof())
)
)
)
)
S.fold([S.spaces, S.string('::'), S.spaces]),
P.apSecond(type),
P.map(type => ({ name, type }))
)
)
)
const pairs: P.Parser> = pipe(
S.fold([C.char('{'), S.spaces]),
P.apSecond(P.sepBy(comma, pair)),
P.apFirst(S.fold([S.spaces, C.char('}')]))
)
const recordConstructor: P.Parser = pipe(
identifier,
P.chain(name =>
pipe(
S.spaces,
P.apSecond(
pipe(
pairs,
P.map(pairs => M.constructor(name, pairs.map(({ name, type }) => M.member(type, some(name)))))
)
)
)
)
)
const positionalConstructor: P.Parser = pipe(
identifier,
P.chain(name =>
pipe(