Java 8 Lambdas provide such an elegant syntax for anonymous classes... When lambdas were first introduced in Java , a lot of people were underwhelmed by them. It is hard to evaluate at first the impact they can have on a well designed API.
Java 8 Lambdas provide such an elegant syntax for anonymous classes... When lambdas were first introduced in Java , a lot of people were underwhelmed by them. It is hard to evaluate at first the impact they can have on a well designed API.
foldMap :: Monoid m => (a -> m) -> t a -> m
? default <T> Extension<T> contraMap(Function<T, S> f)
foldMap :: Monoid m => (a -> m) -> t a -> m
I also prefer the Haskell syntax, but it looks like more of a difference because the implementation is inline.Anyway, tastes and education play a role there, but to me the arrow notation is way easier to read, as it is what I would write on paper.
Not saying that there are no monster type signatures in Haskell (just recovering from one such instance in purescript-halogen), but it's really the most leightweight syntax for annotating types out there.
I often use Haskell signatures in comments when writing JS or whatever, just to keep the types straight.
<T> Extension<T> contraMap(Function<T, S> f); contramap :: (a -> b) -> f b -> f a
http://hackage.haskell.org/package/contravariant-1.3.3/docs/Data-Functor-Contravariant.html#v:contramapIf `f` is Function<T, S> then given `T src`, like we have, then f.apply(src) has type S. But Extension.this.apply is applied to values of S even though T is the thing qualified as an Extension.
Actually, I'm just entirely not sure I know how to read Java type signatures.