MemoEffect

org.atnos.eff.MemoEffect
See theMemoEffect companion object

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

Attributes

Companion
object
Source
MemoEffect.scala
Graph
Supertypes
trait MemoCreation
trait MemoTypes
class Object
trait Matchable
class Any
Show all
Known subtypes
object MemoEffect

Members list

Type members

Inherited types

type _Memo[R] = Member[Memoized, R]

Attributes

Inherited from:
MemoTypes
Source
MemoTypes.scala
type _memo[R] = MemberIn[Memoized, R]

Attributes

Inherited from:
MemoTypes
Source
MemoTypes.scala

Value members

Inherited methods

def getCache[R : _memo]: Eff[R, Cache]

Attributes

Inherited from:
MemoCreation
Source
MemoCreation.scala
def memoize[R : _memo, A](key: AnyRef, a: => A): Eff[R, A]

Attributes

Inherited from:
MemoCreation
Source
MemoCreation.scala
def runFutureMemo[R, U, A](cache: Cache)(effect: Eff[R, A])(using Aux[Memoized, R, U], MemberIn[TimedFuture, U]): Eff[U, A]

Attributes

Inherited from:
MemoInterpretation
Source
MemoInterpretation.scala
def runMemo[R, U, A](cache: Cache)(effect: Eff[R, A])(using Aux[Memoized, R, U], MemberIn[Eval, U]): Eff[U, A]

Attributes

Inherited from:
MemoInterpretation
Source
MemoInterpretation.scala