
23 Apr
2008
23 Apr
'08
12:06 p.m.
2008/4/23 apfelmus
Dan Doel wrote:
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.
Unfortunately, it would be quite ambiguous -- the identity functor overlaps with basically any other. Consider the case: reverse . [[1,2,3],[4,5]] which if (.) is fmap would normally mean [[3,2,1],[5,4]], but if the identity functor is used instead would mean [[4,5],[1,2,3]]. - Cale