2 ms·
Also I don't understand why would you need HKT here. I don't see language limitation here, I see poorly designed inheritance in the standard library. They shoul
by p2t2p 6y ago
Also I don't understand why would you need HKT here. I don't see language limitation here, I see poorly designed inheritance in the standard library. They should've introduced "FlatMappable" type and make Option and Stream extend it. CompletionStage, I'm torn on it, on one hand yes, it is a flatMap essentially but semantics is a bit different...
- p2t2p 6y agoOh my god, there's more to that, Optional is a class, not an interface and it's final :facepalm:
- mrkeen 6y agoI've made my peace with those aspects of the libraries. I'm happy to wrap the standard classes in MyOption, MyStream, etc. Then I can extend FlatMappable myself. I just don't know how to declare and implement FlatMappable in a sane way (preserving type information, not needing casts, etc.)