funcool / lentes

Functional references for Clojure and ClojureScript
https://cljdoc.org/d/funcool/lentes/CURRENT
BSD 2-Clause "Simplified" License
94 stars 10 forks source link

IEquiv for RWFocus? #2

Closed ghost closed 7 years ago

ghost commented 7 years ago

In an app I'm currently developing I found a use cases where it would be beneficial if I could check if two lenses are the same. Currently this is only possible by using deref and compare the values (and that does not guarantee the lenses are pointing at the same location in a datastructure)

would it be possible to implement IEquiv, e.g. by comparing the id of the lens?

niwinz commented 7 years ago

Hi @sj4

The question here is, that it means the two focuses are the same? The response can be:

Maybe I'm missing something, but I don't find where the IEquiv can be useful for focuses, can you elaborate more please!

ghost commented 7 years ago

I think using identical? should solve the case, thanks for the hint, sorry for the noise

niwinz commented 7 years ago

No problem ;)