Add transform contract

This commit is contained in:
Jack Firth 2015-07-08 01:34:27 -07:00
parent 6fe10f3ec4
commit 32c580d849

View File

@ -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))))