Skip to content

Instantly share code, notes, and snippets.

@kubukoz
Created May 20, 2022 20:17
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 kubukoz/e5f80263e74be317e21c9bd6142dbffd to your computer and use it in GitHub Desktop.
Save kubukoz/e5f80263e74be317e21c9bd6142dbffd to your computer and use it in GitHub Desktop.
//>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