Giter VIP home page Giter VIP logo

Comments (2)

phadej avatar phadej commented on June 13, 2024

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.

endgame avatar endgame commented on June 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.