Comments (2)
From sharing between optics
and lens
perspective, there isn't much to gain. Ixed
in optics
and lens
look very different.
And that says that something is missing in the design. I don't know what.
For indexed-traversable
I do use ifor_
and itraverse
, and e.g. ialignWith
which builds on top FunctorWithIndex
; these classes are not lensy at all. But there's something not right about Ixed
without lens
or optics
.
from lens.
The peculiarity seems to come from the fact that optics
is set up to be able to track the kind of optic ix
actually returns. We could capture the "zero-or-one" nature with an operation like ix' :: Index m -> m -> Either m (IxValue m, IxValue m -> m)
. a Traversal
written as an infinite sum of get/set pairs (either you get the structure back, or you get one value and a function that accepts one value, or you get two values and a function that accepts two values, or...), then this is like a "zero or one element unfolding" of that infinite sum.
But optics is able to say "ix
gives you a lens if you index into a Naperian container", and this encoding doesn't.
from lens.
Related Issues (20)
- Does not compile on GHC 9.2.2 (pre-release): Module ‘Data.Semigroup’ does not export ‘getOption’ HOT 2
- Add O(1) `Iso'`s for sets with map representations HOT 2
- `Bizarre` as a superclass of `IndexedComonadStore`?
- `Index` TypeFamily for `Ixed`/`At` inconsistent with FunDeps for `*WithIndex` HOT 3
- Compatibility with transformers-0.6 and mtl-2.3 HOT 12
- FYI: all dependencies should be GHC-9.4 compatible now HOT 2
- creately.com diagram template broken, blocks #828 HOT 2
- Expand tuple accessors to support 26-item tuples
- Add `Zoom` for `Control.Monad.Trans.WriterT.CPS` HOT 1
- Missing combinators for creating and consuming Fold1, and IndexedFold1 's
- Add a strict over? HOT 1
- Are state modifications supposed to be so lazy? HOT 1
- Dead link in description HOT 1
- No accessors are generated when using `NoFieldSelectors` to remove prefixes. HOT 3
- Build failure with GHC-9.6, mtl-2.3.1 but transformers-0.5 HOT 12
- Negative Index onto Text type results in returning first element HOT 4
- Add `toAlternativeOf`? HOT 7
- Declare Fields with Nested Records of types defined in same Splice HOT 1
- Change the link in github HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lens.