Skip to content

Commit

Permalink
Merge pull request #62 from jackfirth/fix-apply-lens-#40
Browse files Browse the repository at this point in the history
Rename apply-lens to focus-lens
  • Loading branch information
jackfirth committed Jul 7, 2015
2 parents a313abc + a4bed63 commit ad7b16c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lenses/core/base.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

(provide let-lens
make-lens
apply-lens
focus-lens
use-applicable-lenses!
(rename-out [lens-struct? lens?]))

Expand All @@ -32,14 +32,14 @@
(define (make-lens getter setter)
(lens-struct getter setter))

(define (apply-lens lens target)
(define (focus-lens lens target)
(match-define (lens-struct get set) lens)
(values (get target)
(set target _)))


(define-syntax-rule (let-lens (view setter) lens-expr target-expr body ...)
(let-values ([(view setter) (apply-lens lens-expr target-expr)])
(let-values ([(view setter) (focus-lens lens-expr target-expr)])
body ...))

(module+ test
Expand Down
2 changes: 1 addition & 1 deletion lenses/main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"list/main.rkt"
"syntax.rkt"
"syntax-keyword.rkt")
apply-lens
focus-lens
drop-lens
lens-set*
lens-transform*
Expand Down

0 comments on commit ad7b16c

Please sign in to comment.