News for hackers. Stuff that matters.
Re:Background: how we got the generics we have (2020) by p2t2p on Thursday April 01, 2021 @11:44AM (#26661956)
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...
Re:Background: how we got the generics we have (2020) by p2t2p on Thursday April 01, 2021 @12:00PM (#26662240)
Oh my god, there's more to that, Optional is a class, not an interface and it's final :facepalm:
Re:Background: how we got the generics we have (2020) by mrkeen on Thursday April 01, 2021 @05:39PM (#26666440)
I'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.)