6 ms·
Is there something like the Y combinator for self types in F bounded OO generic type systems? I just realized it’s the same kind of problem at the type level. E
by seanmcdirmid 8y ago
Is there something like the Y combinator for self types in F bounded OO generic type systems? I just realized it’s the same kind of problem at the type level. E.g.
abstract class FooImpl<Self extends FooImpl<Self>> { Self doIt() { .... } }
As a class with a self type, analogous to an open recursive function, and then:
class FooFinal extends FooImpl<FooFinal> {...}
As it’s call.