Add transform contract
This commit is contained in:
parent
6fe10f3ec4
commit
32c580d849
|
@ -7,10 +7,15 @@
|
|||
(require rackunit
|
||||
fancy-app))
|
||||
|
||||
(provide lens-transform
|
||||
lens-transform*)
|
||||
(provide
|
||||
lens-transform*
|
||||
(contract-out [lens-transform (-> lens? any/c (-> any/c any/c) any/c)]))
|
||||
|
||||
|
||||
|
||||
(define (listof* . contracts)
|
||||
(or/c '() (apply list/c (append contracts (list (apply listof* contracts))))))
|
||||
|
||||
(define (lens-transform lens v f)
|
||||
(let-lens (view setter) lens v
|
||||
(setter (f view))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user