From b2c93f72755328824df55f17d23024f9deb79770 Mon Sep 17 00:00:00 2001 From: Alexis King Date: Mon, 6 Jul 2015 16:05:07 -0700 Subject: [PATCH] Add documentation for and expose lens-thrush Fixes #55 --- lenses/core/compose.scrbl | 10 ++++++++++ lenses/main.rkt | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lenses/core/compose.scrbl b/lenses/core/compose.scrbl index cd2674f..e17f2b8 100644 --- a/lenses/core/compose.scrbl +++ b/lenses/core/compose.scrbl @@ -21,6 +21,16 @@ (lens-set first-of-second-lens '((1 a) (2 b) (3 c)) 200) ]} +@defproc[(lens-thrush [lens lens?] ...) lens?]{ + Like @racket[lens-compose], but each @racket[lens] is combined in the + opposite order. That is, the first @racket[lens] is the first + @racket[lens] that the compound lens’s target is viewed through. + @lenses-examples[ + (define first-of-second-lens (lens-thrush second-lens first-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 diff --git a/lenses/main.rkt b/lenses/main.rkt index 1895712..3ba004a 100644 --- a/lenses/main.rkt +++ b/lenses/main.rkt @@ -16,7 +16,6 @@ apply-lens drop-lens lens-set* - lens-thrush lens-transform* lens-view* list-ref-lens