Polymorphism in the Prelude
amindfv at gmail.com
amindfv at gmail.com
Mon Aug 11 16:03:44 UTC 2014
Why not just explicitly annotate the types?
Tom
El Aug 11, 2014, a las 7:12, Henning Thielemann <schlepptop at henning-thielemann.de> escribió:
> Am 11.08.2014 um 12:24 schrieb Oliver Charles:
>> On 10/08/14 20:26, Henning Thielemann wrote:
>>> I have to strongly agree. I have already written things like
>>>
>>> fmap (fmap (fmap (fmap f)))
>>>
>>> and find it hard to find out later, which fmap refers to Maybe, which
>>> one to List, and which one to Map. That is, I prefer 'map' even if
>>> there is an 'fmap'.
>>
>> But this problem comes up /anywhere/ you are composing polymorphic
>> functions. Just renaming functions in the case of `fmap` just solves
>> that particular problem, but doesn't solve the problem in the general
>> case. I think this is a problem that is truly solved best by editor
>> tools.
>
> I'd prefer to be able to read such code without the help of an editor. E.g.
>
> map (Map.map (Maybe.map (map f)))
>
> makes everything obvious without any tool.
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
More information about the Libraries
mailing list