Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

lazy InputCache for recursive caches

  • Loading branch information...
commit e8b33f9286e796d9f04b9f265e40b9f3c48d5946 1 parent c4ac944
Mark Harrah authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 cache/SeparatedCache.scala
10 cache/SeparatedCache.scala
View
@@ -27,6 +27,16 @@ object InputCache
def write(to: Out, i: I) = fmt.writes(to, i)
def equiv = eqv
}
+ def lzy[I](mkIn: => InputCache[I]): InputCache[I] =
+ new InputCache[I]
+ {
+ lazy val ic = mkIn
+ type Internal = ic.Internal
+ def convert(i: I) = ic convert i
+ def read(from: Input): ic.Internal = ic.read(from)
+ def write(to: Out, i: ic.Internal) = ic.write(to, i)
+ def equiv = ic.equiv
+ }
}
class BasicCache[I,O](implicit input: InputCache[I], outFormat: Format[O]) extends Cache[I,O]
Please sign in to comment.
Something went wrong with that request. Please try again.