A type-class for F[A] monads that are suspendable
and whose evaluation can be memoized, along with a guarantee
that the captured side-effects only happen once.
The memoize operation takes an F[_] instance and
returns a new F that guarantees that its evaluation and
all related side-effects only happen once, with the results
to be reused on subsequent evaluations.
Note that the memoize operation can be a no-op. For example
Scala's Future doesn't need to do anything special as memoization
happens by default and idempotency is guaranteed.
A type-class for
F[A]
monads that are suspendable and whose evaluation can be memoized, along with a guarantee that the captured side-effects only happen once.The
memoize
operation takes anF[_]
instance and returns a newF
that guarantees that its evaluation and all related side-effects only happen once, with the results to be reused on subsequent evaluations.Note that the
memoize
operation can be a no-op. For example Scala'sFuture
doesn't need to do anything special as memoization happens by default and idempotency is guaranteed.