Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename apply-lens to focus-lens #62

Merged
merged 1 commit into from
Jul 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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