An universal monadic data type that consists of many useful monad transformers.
An universal monadic data type that consists of many useful monad transformers.
Do
This Do
type is an opacity alias to UnitContinuation[Resource[UnitContinuation, Try[Value]]]
.
Do companion object for all type classes and helper functions for this Do
type.
ParallelDo
and Do can be converted to each other via scalaz.Tags.Parallel.
Given a Do,
import com.thoughtworks.raii.asynchronous.{Do, ParallelDo} import java.net._ import java.io._ val originalDoInput: Do[InputStream] = Do.autoCloseable(new URL("http://thoughtworks.com/").openStream())
when converting it to ParallelDo
and converting it back,
import scalaz.Tags.Parallel val parallelDoInput: ParallelDo[InputStream] = Parallel(originalDoInput) val Parallel(doInput) = parallelDoInput
then the Do should be still the original instance.
doInput should be(originalDoInput)
ParallelDo.doParallelApplicative for the Applicative type class for parallel computing.
The companion object of Do
Returns an Applicative type class for parallel computing.
Returns an Applicative type class for parallel computing.
This type class requires a Semigroup to combine multiple Throwable
s into one,
in the case of multiple tasks report errors in parallel.
The type-level Pimpl in order to prevent the Scala compiler seeing the actual type of Do
The namespace that contains Do.
Author:
杨博 (Yang Bo) <[email protected]>