Proposal: refactor Arrow class

Twan van Laarhoven twanvl at gmail.com
Mon Jul 16 21:44:03 CEST 2012


>> Is either of these classes enough for the do/if sugar? Or do you also
>> need (&&&) and (|||) for those?
>
> For if or case you need premap and (|||).
> For do you need premap and (&&&).
>
> But if you have Category and premap, you can make (|||) from left,
> and (&&&) from first.

I showed that the weaker isoPremap is enough for `if`, and it also
suffices for getting `(|||)` for `left` and vice versa.

Since you are considering changing the class hierarchy, this is the
time to also make other changes. Even if you don't use isoPremap or
some of the other more general superclasses, it would still be good to
have a nice hierarchy.

And I do have two use-cases for these classes, namely isomorphisms and
lenses. I am sure there are other examples of categories for which
`arr` is too strong, but which do, for example, support `first`. The
current `Arrow` class is too heavy weight. We already split of
Category, but there are more things in between it and full arrows.


Twan



More information about the Libraries mailing list