Cached is completely orthogonal to Query, it can also encapsulate a function or a scalar computation

cvogt <notifications@github.com> wrote:
>> +/** A possibly parameterized query that will be cached for repeated
>efficient
>> +  * execution without having to recompile it every time. The
>compiled state
>> +  * is computed on demand the first time a `Cached` value is
>executed. It is
>> +  * always tied to a specific driver.
>> +  *
>> +  * `Cached` forms a limited monad which ensures that it can only
>contain
>> +  * values that are `Cachable`. */
>> +sealed trait Cached[T] {
>> +  /** The driver which is used for compiling the query. */
>> +  def driver: BasicProfile
>> +
>> +  /** Perform a transformation of the underlying value. The computed
>value must
>> +    * be `Cachable`. The resulting `Cached` instance will be
>recompiled when
>> +    * needed. It does not benefit from this instance already
>containing the
>> +    * compiled state. */
>> +  def map[U, C <: Cached[U]](f: T => U)(implicit ucachable:
>Cachable[U, C]): C =
>
>I fear that this API may be confusing. Why not give Cached the same
>interface like Query with map, filter, take, etc...?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/slick/slick/pull/205/files#r6562395

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.