Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Background: how we got the generics we have (2020). Parent comment
I'm trying to figure out how to refer to flatMap directly from the abstract function, e.g.
flatMapTwice(x, fun) { return x.flatMap(fun).flatMap(fun); }
chain(x, fun1, fun2) { return x.flatMap(fun1).flatMap(fun2); }
It doesn't need to be x.flatMap(f) - I'd be interested seeing a flatMap(x, f) version.
There are no comments on this comment yet.
I'm trying to figure out how to refer to flatMap directly from the abstract function, e.g.
or It should also preserve the type information (just like you did above). I don't want the caller to need to downcast from FlatMappable.It doesn't need to be x.flatMap(f) - I'd be interested seeing a flatMap(x, f) version.