2008/4/23 apfelmus <[EMAIL PROTECTED]>:
> 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
_______________________________________________
Haskell-prime mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-prime