MemoEffect

Memoization effect

Memoize a computation for a given key

This effect can be interpreted with a cache implemented with many different libraries. See Cache.scala for 2 default implementations:

  • one concurrent hashmap (meaning an unbounded cache)
  • one concurrent hashmap with weak references (to evict entries based on garbage collection)

You can implement your own version using ScalaCache for example

Companion
object
trait MemoTypes
class Object
trait Matchable
class Any
object MemoEffect
object all

Type members

Inherited types

type _Memo[R] = Member[Memoized, R]
Inherited from
MemoTypes
type _memo[R] = MemberIn[Memoized, R]
Inherited from
MemoTypes

Value members

Inherited methods

def getCache[R : _memo]: Eff[R, Cache]
Inherited from
MemoCreation
def memoize[R : _memo, A](key: AnyRef, a: => A): Eff[R, A]
Inherited from
MemoCreation
def runFutureMemo[R, U, A](cache: Cache)(effect: Eff[R, A])(implicit m: Aux[Memoized, R, U], future: MemberIn[TimedFuture, U]): Eff[U, A]
Inherited from
MemoInterpretation
def runMemo[R, U, A](cache: Cache)(effect: Eff[R, A])(implicit m: Aux[Memoized, R, U], eval: MemberIn[Eval, U]): Eff[U, A]
Inherited from
MemoInterpretation