{"size": 1261, "ext": "scrbl", "max_stars_repo_path": "lens-doc/unstable/lens/zoom.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/zoom.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/zoom.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": 38.2121212121, "max_line_length": 91, "alphanum_fraction": 0.7002379064}
#lang scribble/manual

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

@title{Lenses that transform subpieces}

@defproc[(lens-zoom [zoom-lens lens?] [transform-lens lens?]) lens?]{
Creates a lens that transforms the subpiece of the target that @racket[zoom-lens]
views with @racket[transform-lens].

@racketblock[(lens-view (lens-zoom zoom-lens transform-lens) target)]
is equivalent to:
@racketblock[(lens-transform zoom-lens target (λ (v) (lens-view transform-lens v)))]

@lens-unstable-examples[
  (define first-zoom-second-lens
    (lens-zoom first-lens second-lens))
  (lens-view first-zoom-second-lens '((1 2 3) b c))
  (lens-set first-zoom-second-lens '((1 2 3) b c) '(2000 b FOO))
]}

@defproc[(lens-zoom* [zoom-lens lens?] [transform-lens lens?] ... ...) lens?]{
A multi-arg version of @racket[lens-zoom], analogous to
@racket[lens-transform/list]. It is equivalent to
@racket[(lens-thrush (lens-zoom zoom-lens transform-lens) ...)].
@lens-unstable-examples[
  (define first-zoom-second/third-zoom-first-lens
    (lens-zoom* first-lens second-lens
                third-lens first-lens))
  (lens-view first-zoom-second/third-zoom-first-lens '((1 2 3) foo (a b c)))
  (lens-set first-zoom-second/third-zoom-first-lens '((1 2 3) foo (a b c)) '(200 FOO asdf))
]}
