patch applied (haskell-prime-status): add ""Make $ left
associative, like application"
apfelmus
apfelmus at quantentunnel.de
Wed Apr 23 14:17:25 EDT 2008
Cale Gibbard wrote:
> apfelmus wrote:
>>
>> 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]].
Whoops, what I did think here? I somehow thought that the argument of
the function applied ( reverse in this case) would fix the functor. But
this only works if the function is monomorphic:
(reverse :: [[Int]] -> [[Int]]) . [[1,2,3],[4,5]]
(reverse :: [Int] -> [Int]) . [[1,2,3],[4,5]]
not if it's polymorphic.
Regards,
apfelmus
More information about the Haskell-prime
mailing list