Comments (5)
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.
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.
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.
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.
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)
- struct->vector isomorphism HOT 5
- lens-zoom examples shouldn't use isomoprhism lenses
- Add digit->char isomorphism
- There should be a test for the cond-lens error case.
- There should be a test for the string-split-lens case where the input violates the lens laws HOT 2
- struct->struct lens? HOT 1
- Rethink unstable collection? HOT 2
- Test `lens-compose` / `compose` relationship HOT 1
- using append* n times vs. flattening a nested list of a given depth HOT 9
- Matrix lenses? HOT 2
- Disarm and re-arm syntax objects within srcloc-lens setters HOT 1
- Modulo lens HOT 3
- Struct inheritence and lenses HOT 32
- How should we name lenses for improper syntax lists? HOT 6
- separate tests into `lens-test` repository HOT 13
- Add prisms or other functionality that tests a lens's applicability HOT 4
- lens-join/* functions produce non-lenses when views overlap HOT 2
- Docs: Is the "last set wins" law right (strong enough)? HOT 3
- Waffle.io has closed HOT 1
- Add seemingly missing (list-filtered-lens) function. HOT 5
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.