Created
May 20, 2022 20:17
-
-
Save kubukoz/e5f80263e74be317e21c9bd6142dbffd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//>using scala "3.1.1" | |
//>using lib "org.typelevel::cats-core:2.7.0" | |
//>using lib "org.typelevel::cats-effect:3.3.9" | |
sealed trait Error extends Product with Serializable | |
object Error { | |
case object C extends Error | |
} | |
object demo { | |
import util.chaining._ | |
import cats.implicits._ | |
import cats.effect._ | |
import cats.data._ | |
val r = | |
for { | |
a <- IO(42).pipe(EitherT.liftF(_)) | |
b <- 42.asRight.toEitherT[IO] | |
c <- Error.C.asLeft.toEitherT[IO] | |
} yield () | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment