Dan Doel wrote:
3) Left associative ($) is consistent with left associative ($!).

   (f $! x) y z
   ((f $! x) $! y) $! z

Left associative, these are:

   f $! x $ y $ z
   f $! x $! y $! z

Nice! Subconsciously, the fact that ($!) is currently not left associative has always bitten me.


In the light of Cale's plan to make (.) equivalent to fmap , there is also the option to redefine ($) to mean fmap . This would eliminate the need for a special <$> for applicative functors.

Note that setting (.) or ($) = fmap subsumes function application, because we have

  fmap :: (a -> b) -> a -> b

for the /identity functor/. In other words, the current ($) and (.) are just special cases of the general fmap . Unfortunately, the identity functor currently can't be overloaded, although I think it would be unambiguous.


Regards,
apfelmus

_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to