com.twitter.storehaus.cache
Returns an instance of Function2 memoized using the supplied mutable cache.
scala> import com.twitter.storehaus.cache._ scala> type Input = (Int, Int) scala> val cache = MapCache.empty[Input, String].toMutable() cache: <munged> scala> val memoFn = Memoize(cache) { (x1, x2) => | println("calculating!") | (x1, x2).toString | } memoFn: <munged> scala> memoFn(1, 2) calculating! res1: String = (1, 2) scala> memoFn(1, 2) res2: String = (1, 2)
(Since version 2.8.0) Use 'curried' instead
Returns an instance of Function2 memoized using the supplied mutable cache.