A
Size: a a a
A
A
R
A
C
AS
def suspend[F[_], A](op: => A)(implicit ap: Applicative[F], de: Defer[F]): F[A] = de.defer(ap.pure(op))
Oℕ
AS
Oℕ
Oℕ
AS
cats.Defer
явно упомянуто откладывание (the ability to defer
)* Defer is a type class that shows the ability to defer creation
* inside of the type constructor F[_].
Oℕ
Oℕ
Oℕ
AS
Oℕ
Oℕ
AS
def suspend[F[_], A](op: => A)(implicit ap: ApplicativeError[F, Throwable], de: Defer[F]): F[A] ={
de.defer {
val tried = Try(op)
ap.fromTry(tried)
}
}
Oℕ
Oℕ
def suspend[F[_], A](op: => A)(implicit ap: ApplicativeError[F, Throwable], de: Defer[F]): F[A] ={
de.defer {
val tried = Try(op)
ap.fromTry(tried)
}
}