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
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
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.