-
Notifications
You must be signed in to change notification settings - Fork 527
Open
Description
Regular Map.get allows using subtypes:
val v = Map(Option("foo") -> "bar", Option(23) -> 13)
val b = v.get(Some("foo")) // "bar"but the same isn't true of HMap, because it can't resolve the implicits necessary to prove that the value type is correct:
val v = HMap[(Option ~?> Id)#λ](Option("foo") -> "bar", Option(23) -> 13)
val b = v.get(Some("foo"))
// [error] could not find implicit value for parameter ev: Option ~?> shapeless.Id#λ[Some[String],V]
// [error] val b = v.get(Some("foo"))
// [error] ^Would it be possible / sensible to make ~?>.λ variant in K, or would that cause other problems?