[GHC] #4517: Add Data.Functor.Backwards to transformers
roconnor at theorem.ca
roconnor at theorem.ca
Tue Nov 23 11:40:40 EST 2010
Discussion so far.
There are three aspects of functors that can be "reversed"
1. Foldable-Traversable
2. Applicative
3. Alternative-MonadPlus
It appears at first glance that all three of these aspects are independent
and thus we would need three different wrappers to implement the three
separate functionality. For example lists have all three aspects and one
can imagine possibly reversing list instances independently in each of the
aspects.
So far two name are proposed: Backwards and Reverse. There is one request
for not using Reverse because someone want to use it to dualize Ord;
however it was suggested that Converse be used for Ord.
The question of whether 3 is or isn't independent of the other two is made
more difficult due to Alternative/MonadPlus not having a clear set of
laws. In fact, MonadPlus has two candidate sets of laws that are not
compatible with each other.
One possibility is to split this proposal into three proposal, one for each
of the aspects. I suggest not doing this, or at least not splitting it up
yet, since, although these items appear that they can be applied
independently, they are still interrelated as one can see by the fact that
the Traversable Reverse instance uses the Applicative Reverse instance.
--
Russell O'Connor <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
More information about the Libraries
mailing list