Skip to content

nth should support lists #10

Description

@metametadata

This would be convenient because often parts of bigger data end up being lists after applying core functions (e.g. map).

Steps:

(require '[lentes.core :as l])
(let [data (list 0 1 2 3)
      lense (l/nth 2)]
  (println "A ->" (l/focus lense data))
  (l/over lense inc data)
  (println "B ->" (l/focus lense data)))

Expected:

A -> 2
B -> 3

Actual:

1 -> 2
Uncaught Error: No protocol method IAssociative.-assoc defined for type cljs.core/List: (0 1 2 3)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions