I can't for the life of me figure out why the following does not work. I've tried all sorts of combinations of implicit evidence and still can't get it to compile. What I am trying to do is a type safe map on the results of Jedis pipeline calls. These calls return a
import redis.clients.jedis.{Response, Pipeline}
import shapeless._
import poly._
class RedisPipeline[T <: HList] private[client](pipeline: Pipeline, list: T = HNil) {
import RedisPipeline._
private[client] def sync() = {
pipeline.sync()
list.map(response)
}
}
object RedisPipeline {
object response extends (Response ~> Id) {
def apply[T](f: Response[T]): Id[T] = f.get()
}
}
I keep getting the following compiler error
[error] [...]/redis/client/RedisPipeline.scala:15: could not find implicit value for parameter mapper: shapeless.ops.hlist.Mapper[....redis.client.RedisPipeline.response.type,T]
[error] list.map(response)
[error] ^
[error] one error found
Any help would be greatly appreciated.