ekmett / lens

Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens
http://lens.github.io/
Other
2.03k stars 274 forks source link

Some classes in their own package #526

Closed tonymorris closed 9 years ago

tonymorris commented 9 years ago

I am currently toying with the idea of making libraries not depend on the lens package, but instead, depend on smaller packages like profunctor.

This means I must also forgo type-class instances e.g. Swapped and Reversing from Control.Lens.Iso. Perhaps these type-classes can go in their own package? Is there an appropriate way of lessening the dependency on lens while achieving the benefits of things like Swapped?

ekmett commented 9 years ago

lens has a dozen of these little classes.

Swapped is pretty small, and has no weird instances to worry about.

Reversing would have a bunch of dependencies. vector, text, bytestring, etc.

But whenever this comes up, folks inevitably want all the FunctorWithIndex, FoldableWithIndex, TraversableWithIndex, Each, Ixed, At...

By the time you get done sliding down the slippery slope with that we get right back where we are with dependencies and its even harder for us to work.

bennofs commented 9 years ago

For Swapped, could that be moved to bifunctors? That would at least solve this issue.

bennofs commented 9 years ago

Ah, the issue is probably that this would add a profunctors dependency to bifunctors

ekmett commented 9 years ago

I'm going to close this as I just don't see this happening at this point.