3 ms·
I do think familiarity plays a big role. I find the Haskell syntax much more pleasant than Java, even though I'm perfectly familiar with both. The equivalent s
by Twisol 5y ago
I do think familiarity plays a big role. I find the Haskell syntax much more pleasant than Java, even though I'm perfectly familiar with both.
The equivalent signature in Java (if we could abstract over type functions) would be:
interface Functor<F<_>> {
<A, B> Function<F<A>, F<B>> map(Function<A, B> f);
}
You'll find very similar in Scala's `cats`, up to some currying and reordering. [0]
[0] https://typelevel.org/cats/typeclasses/functor.html https://typelevel.org/cats/typeclasses/functor.html
- Littlebigo 5y agoI absolutely agree, I was just adding the explanation for anyone unfamiliar with the syntax.
- Twisol 5y agoAnd I was building on yours :) I hope you didn't mind.