diff --git a/cache.rkt b/cache.rkt index c44f26b..a698889 100644 --- a/cache.rkt +++ b/cache.rkt @@ -1,8 +1,9 @@ #lang racket/base -(require (for-syntax racket/base)) +(require (for-syntax racket/base) racket/contract) (provide (all-defined-out)) -(define (make-caching-proc base-proc) +(define/contract (make-caching-proc base-proc) + (procedure? . -> . procedure?) (let ([cache (make-hash)]) (λ args (hash-ref! cache args (λ () (apply base-proc args))))))