Closed arybczak closed 3 years ago
I'd like to have that package, especially if we get lens
use it. Otherwise I think it would be useless.
If lens
would also use map-with-index
(because indexed-functors
is something different, given indexed-profunctors
), then there might be enough "pressure" to reverse the dependency so unordered-containers
and vector
would depend on it, not the other way around. This is justified as it is more likely (though highly unlikely) that FunctorWithIndex
would be in base
than that the HashMap
would be there.
So, I think we have to convince Edward (about the performance) first before making the package. I also think that ifolded
in lens
don't need to be a member, but it's just a hunch.
I think this might be useful to packages other than lens
, and if someone wants it then splitting it out makes sense, but I agree the motivation is much more compelling if lens
itself can use it. (I wonder if any other lens libraries might benefit from it? My first thought was microlens
but that doesn't seem to have indexed optics.)
Is this perhaps a resurrection of Edward's https://hackage.haskell.org/package/keys-3.12.3 library?
@ocharles Right, it looks like it would be a subset of it. Most of the dependencies of this package would have to be reversed though.
This is done now.
These can be made a standalone package easily.
Then:
unordered-containers
andvector
can supply instances instead ofoptics-extra
lens
can switch to using these classes so that we don't duplicate them (I saw claims that they need to haveifolded
,itraversed
andimapped
as class member for performance, but I doubt that's the case considering that we don't do that and have the same performance in benchmarks aslens
).Thoughts?