Effect CommunityEC
Effect Community2y ago
8 replies
sign error

Issue returning ParseError

Hello There … I am just trying to return a ParseResult, but it wont compile as I expect. I have this function:

const fromInput: (i: unkown) => : E.Either<ParseResult.ParseError, Foo> => {
  const foo = …

  return pipe(
    ParseResult.succeed(foo),
    E.mapLeft(e => …) // <- ??? e: Foo

  )
}

So the resulting / inferred error type is Foo. Looking at ParseResult.succeed I find: export const succeed: <A>(a: A) => Either.Either<ParseIssue, A>, so how could that be? What am I doing wrong here??
Was this page helpful?