Giter VIP home page Giter VIP logo

Comments (5)

AlexKnauth avatar AlexKnauth commented on July 1, 2024

Why not?

I understand that you want to get rid of any possible perceived confusion or ambiguity for whether it returns 1 value or 2, but it seems to me that #14 is a much better way to avoid confusion about that.

from lens.

jackfirth avatar jackfirth commented on July 1, 2024

This is in addition to #14, not instead of. This allows more flexibility in the implementation of how lenses are used to extract views and contexts from values. Fixing #14 would probably involve adding a lens-apply function or some sort that gives the view and context given a lens and target.

from lens.

AlexKnauth avatar AlexKnauth commented on July 1, 2024

But once the potential confusion is removed by #14 , why not allow an arbitrary expression there?

By the way, another example of a use of an arbitrary expression in let-lens is this, using a my dotmethod meta-language:

#lang dotmethod racket

require lenses/applicable

dotmethod list? lst.ref(i)
  ((list-lens i) lst)

define lst1 '(a b c d)

let-lens [val ctxt] lst1.ref(2)
  values
    val          ; 'c
    ctxt("hole") ; '(a b "hole" d)

from lens.

jackfirth avatar jackfirth commented on July 1, 2024

I don't want arbitrary expressions to be interpreted as lens calls, I only want lenses with targets to be interpreted as lens calls. If you were using non-applicable lenses after #14, it wouldn't make sense to say lenses can act as a functions only inside let-lens and aren't functions anywhere else, when instead I just treat them as arguments to let-lens.

from lens.

AlexKnauth avatar AlexKnauth commented on July 1, 2024

Ok I see what you're saying now. I still think it would be useful, but it's not necessary, and you're right, it doesn't let you check that.

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.