I had to use some initial empty state to guarantee that "path" is translated into a Witness. Why? Because an extension of String using implicit class was not able to derive a Witness, as Scala/Shapeless is not able to proof that the given String is a literal/singleton.
Another way could be to change the associativity (:>: instead of :>) and create GetCons, PutCons, ... as initial states with an empty HList type. Thus, we should be able to write:
val Api = "find" :>: Segment[String]('name) :>: Get[User]
I had to use some initial empty state to guarantee that
"path"is translated into aWitness. Why? Because an extension ofStringusingimplicit classwas not able to derive aWitness, as Scala/Shapeless is not able to proof that the given String is a literal/singleton.Another way could be to change the associativity (
:>:instead of:>) and createGetCons,PutCons, ... as initial states with an emptyHListtype. Thus, we should be able to write: