{"size": 1068, "ext": "scrbl", "max_stars_repo_path": "lens-doc/lens/private/compound/compose.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/lens/private/compound/compose.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/lens/private/compound/compose.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": 36.8275862069, "max_line_length": 79, "alphanum_fraction": 0.7097378277}
#lang scribble/manual

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


@defproc[(lens-compose [lens lens?] ...) lens?]{
  Composes the given lenses together into one @italic{compound lens}.
  The compound lens operates similarly to composed functions do in
  that the last @racket[lens] is the first @racket[lens] the compound
  lens's target is viewed through. Each successive lens "zooms in"
  to a more detailed view. When called with no arguments, @racket[lens-compose]
  produces the identity lens.
  @lens-examples[
    (define first-of-second-lens (lens-compose first-lens second-lens))
    (lens-view first-of-second-lens '((1 a) (2 b) (3 c)))
    (lens-set first-of-second-lens '((1 a) (2 b) (3 c)) 200)
]}

@defthing[identity-lens lens?]{
  The identity lens. Performs no destructuring at all - it's view is
  the target itself. For all lenses, both
  @racket[(lens-compose lens identity-lens)] and
  @racket[(lens-compose identity-lens lens)] are equivalent to
  @racket[lens].
  @lens-examples[
    (lens-view identity-lens 4)
    (lens-set identity-lens 4 'a)
]}
