Open neko-kai opened 5 years ago
Perhaps worth noting: there is relevant previous work on polymorphic implicits; see COCHIS: Stable and Coherent Implicits.
Queries can be polymorphic too. For instance, the following example extracts the polymorphic implicit with a polymorphic query.
implicit (Λα.(λ?α.(?α, ?α))) in ?(∀β.β ⇒ (β×β)))
Polymorphic function values exist now, however currently they can't be discovered from existing polymorphic implicits:
Specific kinds of polymorphic instances can be auto-lifted on library level, which is what we use in Scala 2:
However, direct language support is highly desired!
Motivation for it is the same as for an existing haskell feature, quantified constraints.