Skip to content

Instantly share code, notes, and snippets.

@djspiewak
Created January 5, 2020 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djspiewak/8a2e6e9490f12e92f296d0b18f0308e1 to your computer and use it in GitHub Desktop.
Save djspiewak/8a2e6e9490f12e92f296d0b18f0308e1 to your computer and use it in GitHub Desktop.
scala> run(F.handleErrorWith(F.map(fa)(_.asRight[Int]))(e => F.pure(e.asLeft[String])))
res2: ce3.ExitCase[Option,Int,Either[Int,String]] = Errored(42)
scala> run(F.handleErrorWith(fa.map(_.asRight[Int]))(e => F.pure(e.asLeft[String])))
handling 42
res3: ce3.ExitCase[Option,Int,Either[Int,String]] = Completed(Some(Left(42)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment