Add flipped fmap
Johan Tibell
johan.tibell at gmail.com
Wed Apr 7 09:33:51 EDT 2010
Hi Felipe,
On Wed, Apr 7, 2010 at 3:09 PM, Felipe Lessa <felipe.lessa at gmail.com> wrote:
> On Wed, Apr 07, 2010 at 11:13:02AM +0200, Bas van Dijk wrote:
>> I would like to propose adding a flipped variant of <$> to Data.Functor:
>>
>> (<$$>) ∷ Functor f ⇒ f α → (α → β) → f β
>> (<$$>) = flip (<$>)
>
> +1
>
> I've needed <$$> many times and had to use 'flip fmap' instead.
In my opinion this is not a good criteria for including a function.
For any function composition you can find a subset of the community
that uses that particular composition. Yet, if we add all the function
compositions that some group of people use in their code our APIs get
much more complicated.
To make matters worse, the incentives for arguing for and against any
particular addition are somewhat perverse: The people who use the
particular composition think it's a great idea, they can make their
own code a bit more beautiful. The people who don't use it would
perhaps prefer to not see it added but it's time consuming to argue
against every single proposal and the benefit to get any particular
proposal rejected is small.
This is how many APIs at [work] got more complicated. Someone argues
very strongly that they need this particular addition and the
maintainer gets many addition proposals. Eventually he/she gives in.
After some time someone rewrites the library from scratch as it's to
hard to understand anymore.
-- Johan
More information about the Libraries
mailing list