{"size": 912, "ext": "scrbl", "max_stars_repo_path": "lens-doc/unstable/lens/map.scrbl", "max_stars_repo_name": "AlexKnauth/lens", "max_stars_repo_stars_event_min_datetime": "2015-07-08T12:56:46.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-17T21:21:54.000Z", "max_issues_repo_path": "lens-doc/unstable/lens/map.scrbl", "max_issues_repo_name": "AlexKnauth/lens", "max_issues_repo_issues_event_min_datetime": "2015-07-07T01:47:59.000Z", "max_issues_repo_issues_event_max_datetime": "2019-09-10T18:35:17.000Z", "max_forks_repo_path": "lens-doc/unstable/lens/map.scrbl", "max_forks_repo_name": "AlexKnauth/lens", "max_forks_repo_forks_event_min_datetime": "2015-07-07T05:01:29.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-16T00:37:04.000Z"}
{"max_stars_count": 66, "max_issues_count": 199, "max_forks_count": 11, "avg_line_length": 39.652173913, "max_line_length": 94, "alphanum_fraction": 0.6271929825}
#lang scribble/manual

@(require lens/private/doc-util/main)

@title{Lenses that map over lists and vectors}

@defproc[(map-lens [lens lens?]) lens?]{
Creates a lens that maps @racket[lens] over a target list.
@lens-unstable-examples[
  (lens-view (map-lens first-lens) '((a b) (c d) (e f)))
  (lens-set (map-lens first-lens) '((a b) (c d) (e f)) '(1 2 3))
  (lens-transform (map-lens first-lens) '((a b) (c d) (e f)) (λ (xs) (map symbol->string xs)))
]}

@defproc[(vector-map-lens [lens lens?]) lens?]{
Creates a lens that maps @racket[lens] over a target vector with @racket[vector-map].
@lens-unstable-examples[
  (lens-view (vector-map-lens first-lens) '#((a b) (c d) (e f)))
  (lens-set (vector-map-lens first-lens) '#((a b) (c d) (e f)) '#(1 2 3))
  (lens-transform (vector-map-lens first-lens) '#((a b) (c d) (e f))
                  (λ (xs) (vector->immutable-vector (vector-map symbol->string xs))))
]}
