ekmett / lens

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

Deques #522

Open treeowl opened 9 years ago

treeowl commented 9 years ago

It seems a bit odd to implement deques in lens. The dequeue package needs its length annotations strictified, but that shouldn't be hard to accomplish.

ekmett commented 9 years ago

We used to have it internally so that we could properly implement indexed traversals for free monads.

treeowl commented 9 years ago

I have no idea what that means, sadly. Is it still necessary to have it implemented internally?

ekmett commented 9 years ago

well, i confess to having some code that uses it from outside lens, since it knows it is in there, but we aren't currently using it in any instances any more, so it is something we could consider removing.

ekmett commented 9 years ago

on the other hand, the instances like

instance FoldableWithIndex i f => FoldableWithIndex [i] (Free f)

would be for example asymptotically more efficient if it used

instance FoldableWithIndex i f => FoldableWithIndex (Deque i) (Free f)

but for that we'd probably want to consider promoting it to a non-internal module.