Closed
Description
Right now, the syntax for explicit capture polymorphism is quite noisy and irregular:
val b: Bar^ = ???
def capturePolyDef[A^,
B >: CapSet <: A,
C >: CapSet <: CapSet^{B^},
D >: CapSet <: C,
E >: CapSet <: CapSet^{D^},
F >: CapSet <: CapSet^{A^,b},
X >: CapSet <: CapSet^{F^,D^},
Y >: CapSet^{F^} <: CapSet^{F^,A^,b},
Z >: CapSet^{b} <: CapSet^{b,Y^}] = ???
For example:
-
There are too many hats
^
and it's not always clear when they are needed, e.g., all the type variables in the example are capture variables, but onlyA
's declaration carries the^
(which is a shorthand forA >: CapSet <: CapSet^
. -
There's two ways to write down a capture variable's bounds, e.g.,
E
's upper bound isCapSet^{D^}
but could equivalently be written as justD
. -
Lots of
CapSet
mentions everywhere, which seems a bit clunky to express simple subset relationships. -
TODO: how does/will Capybara affect capture set notations?
Let's use this issue to track ideas for making the notations more palatable.