We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I evaluate the composition example (using cider nrepl) I get an "nth not supported on this type: Long" error.
user> (require '[lentes.core :as l]) nil user> (def my-lens (comp l/fst l/fst (l/nth 2))) #'user/my-lens user> (def data [[0 1 2] [3 4 5]]) #'user/data user> (l/focus my-lens data) UnsupportedOperationException nth not supported on this type: Long clojure.lang.RT.nthFrom (RT.java:888) user>
Either my-lens should have one fewer l/fst function in the composed function or the data needs another level of square brackets, right?
This works for me:
user> (def my-lens2 (comp l/fst (l/nth 2))) #'user/my-lens2 user> (l/focus my-lens2 data) 2 user> (def data2 [[[0 1 2] [3 4 5]]]) #'user/data2 user> (l/focus my-lens data2) 2 user>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I evaluate the composition example (using cider nrepl) I get an "nth not supported on this type: Long" error.
user> (require '[lentes.core :as l])
nil
user> (def my-lens (comp l/fst l/fst (l/nth 2)))
#'user/my-lens
user> (def data
[[0 1 2]
[3 4 5]])
#'user/data
user> (l/focus my-lens data)
UnsupportedOperationException nth not supported on this type: Long clojure.lang.RT.nthFrom (RT.java:888)
user>
Either my-lens should have one fewer l/fst function in the composed function or the data needs another level of square brackets, right?
This works for me:
user> (def my-lens2 (comp l/fst (l/nth 2)))
#'user/my-lens2
user> (l/focus my-lens2 data)
2
user> (def data2
[[[0 1 2]
[3 4 5]]])
#'user/data2
user> (l/focus my-lens data2)
2
user>
The text was updated successfully, but these errors were encountered: