Loose end: zip

Doug Lea dl at cs.oswego.edu
Mon Jun 10 10:18:12 PDT 2013


On 06/10/13 13:08, Paul Sandoz wrote:
>
> Yes, cause i did not want to add Pair :-) so I think this just adds to the argument this function it is not very helpful until the language has tuples.
>

And stepping back slightly further, ALL of the problems with Optional,
flatMap, zip, etc ultimately boil down to this. If Java had a distinct
type system for {tuple, value, struct, packed} types, then the way
to handle all of these would be obvious. Those of us who believe that
JVMs will reasonably soon support these resist doing the wrong thing now.
Others are happy to use the current fake-value-type workarounds, but
should bear in mind that some usages just won't work in a very defensible
way. And others won't work in a very FPish way.


-Doug




More information about the lambda-libs-spec-experts mailing list