The multiple definitions of apply
can be pretty confusing for beginners (at least it was for me), and now it’s a bit awkward when referring to apply
in documentation, since I feel like additional clarification is often needed.
Control.Apply
apply :: forall f a b. Apply f => f (a -> b) -> f a -> f b
<*>
Data.Function
apply :: forall a b. (a -> b) -> a -> b
$
It also seems like it would be easier to remember the infix notation if <*>
was swapped with map
's <$>
, although that would be a departure from Haskell. I guess Haskell doesn’t have this issue with overlapping function names, since it just defines these infix operators without a named function.
One way to add clarity is to rename $
's apply
to something like noParens
. It seems like only the infix operator is used (and exported by Prelude
), so changing the underlying function name wouldn’t be too annoying of a breaking change.