thoughtworksinc / tryt.scala   3.0.0

Apache License 2.0 GitHub

Monad transformers for exception handling

Scala versions: 3.x 2.13
Scala.js versions: 1.x

tryt.scala

Build Status Latest version Latest version Scaladoc

tryt.scala contains Scalaz monad transformers for exception handling.

There are two monad transformers: the invariant TryT and the covariant TryT. Unlike scala.EitherT's, those TryT transformers handle both exceptions thrown by native Java or Scala methods and exceptions raised by MonadError.raiseError.

Covariant TryT

Covariant TryT works with monadic data types whose kind is F[+A], like scalaz.concurrent.Future or scalaz.Name.

To use covariant TryT, add the following setting to your build.sbt,

libraryDependencies += "com.thoughtworks.tryt" %% "covariant" % "latest.release"

and check the Scaladoc for usage.

Invariant TryT

Invariant TryT works with all monadic data types

To use invariant TryT, add the following setting to your build.sbt,

libraryDependencies += "com.thoughtworks.tryt" %% "invariant" % "latest.release"

and check the Scaladoc for usage.