Add flipped fmap

Edward Kmett ekmett at
Wed Apr 7 09:57:02 EDT 2010

On Wed, Apr 7, 2010 at 9:42 AM, Johan Tibell <johan.tibell at> wrote:

> Hi Bas,
> On Wed, Apr 7, 2010 at 2:11 PM, Bas van Dijk <v.dijk.bas at> wrote:
> > Of course that problem can also be solved by exporting these trivial
> > compositions from a different module from which the primitives are
> > exported. However some of these trivial compositions are so useful
> > that users tend to always include both the primitive module and the
> > helper module, thereby defeating the purpose of the split modules a
> > bit.
> Adding more modules also add more complexity.

I would argue that adding one function to a module that only exports a
single method that is already available through Control.Applicative is
hardly breaking its complexity budget. ;)

> While documentation certainly helps it doesn't solve the whole
> problem. The API is still bigger, there are more things to read and
> understand. More operators also make user code harder to understand
> and I think we should only use operators (and only a minimal amount of
> them) for very fundamental operations (like arithmetic). Functors are
> fundamental to they deserve an operator for fmap, <$>, as learning
> what it means pays off in the long run if it's used frequently. If an
> operator would only be used infrequently it's a good argument for
> using a more descriptive function name instead of an operator.

I'm more surprised that this combinator of this sort is NOT already present
and since the applicative equivalent is present in Control.Applicative
explaining away its absence is harder than justifying its inclusion.

+1 from me.

-Edward Kmett
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Libraries mailing list