I'm trying to implement a filter such as the one described in this gist (please see the last comment).
I want to wrap the salad bowl into a Fruits class, like this:
scala> class Fruits[L <: HList](val bowl: FruitBowl[L])
I then want to create multiple fruits in a list, like this:
scala> val fruits = List(new Fruits(new FruitBowl(Apple() :: Pear() :: HNil)), new Fruits(new FruitBowl(Pear() :: HNil)))
Then I just want to get the apple parts of each fruits, so I try to filter :
scala> fruits.map(_.bowl.getAll[Apple])
But then I get the following error :
<console>:16: error: could not find implicit value for parameter pf: shapeless.ops.hlist.Partition[_2,Apple]
fruits.map(_.bowl.getAll[Apple])
But I though the Partition was supposed to be generic so I see no reason why it shouldn't be used...
I don't understand what's going on here with the implicits. Any idea of what's going wrong ?