Add flipped fmap
Johan Tibell
johan.tibell at gmail.com
Wed Apr 7 09:42:48 EDT 2010
Hi Bas,
On Wed, Apr 7, 2010 at 2:11 PM, Bas van Dijk <v.dijk.bas at gmail.com> 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'm more in favor of exporting both the primitive and the trivial
> compositions from the same module provided there's good documentation
> with clear sectioning available.
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.
-- Johan
More information about the Libraries
mailing list