Hacker News new | past | comments | ask | show | jobs | submit login

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: