Lenses + pathEq
See original GitHub issueHi,
I am using lenses extensively and I am defining all data focusers as lenses. Problem is when I want to use functions like pathEq
. These functions are not designed to work with lenses. I can overcome this limitation
with simple shortcut
const value = view(lens, object);
console.dir(value === exptected)
or with composition
flow(
view(lens, object),
eq(exptected)
)()
But this doesn’t seem quite right. I am inclined to create my own util lensEq
with this signature
lensEq :: Lens -> Any(exected) -> Any(focused object) -> Boolean
I am just wondering, am I missing something in ramda ? If not, is lensPath
the right direction to go ?
Thank you very much
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Ramda Documentation
A special placeholder value used to specify "gaps" within curried functions, allowing partial application of any combination of arguments, regardless of their ...
Read more >Methods | Nanoutils
Compares a value with an argument which is passed to lens -like function using equals. import { eqLens, lens } from 'nanoutils' const...
Read more >Use Ramda.js to pull off items from object - Stack Overflow
Ramda has a generic lens function, and specific ones for an object ... const lensMatch = (path) => (key) => lens ( find...
Read more >Lenses + pathEq - - Bountysource
Hi,. I am using lenses extensively and I am defining all data focusers as lenses. Problem is when I want to use functions...
Read more >Ravendree Pather Optometrist - Facebook
Have a high prescription ? Why settle for thick, heavy and bulky lenses? Have your lenses thinned down by opting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
cookbook sounds good to me!
@CrossEye I have added the link of the article to ramda Wiki homepage (title:
Composing lenses in Ramda
). I will also submit a recipe for lens composition in a couple of days.