The problem is that Java's type system is not able to express these powerful abstractions. I've added the code for mapAccumR to the article. You can see that it requires any traversable t and later as third argument is t b meaning this traversable t contains a b, whatever that might be. In Java terms: t is Generic, kinda like <T extends Traversable>, the problem is the B. You cannot have generic generics in Java (also called higher-order types).
The problem is that Java's type system is not able to express these powerful abstractions. I've added the code for
mapAccumR
to the article. You can see that it requires any traversablet
and later as third argument ist b
meaning this traversablet
contains ab
, whatever that might be. In Java terms:t
is Generic, kinda like<T extends Traversable>
, the problem is theB
. You cannot have generic generics in Java (also called higher-order types).is not valid Java