-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.rkt
51 lines (37 loc) · 1.01 KB
/
main.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#lang racket/base
(require
racket/contract
with-cache/private/with-cache)
(define keys/c
(or/c #f (listof (or/c parameter? (-> any/c)))))
(define equivalence/c
(flat-named-contract "equivalence/c"
(and/c procedure? (procedure-arity-includes/c 2))))
(provide
equivalence/c
get-with-cache-version
parent-directory-exists?
(contract-out
[with-cache-logger
logger?]
[*use-cache?*
(parameter/c boolean?)]
[*with-cache-fasl?*
(parameter/c boolean?)]
[*current-cache-directory*
(parameter/c (and/c path-string? directory-exists?))]
[*current-cache-keys*
(parameter/c keys/c)]
[*keys-equal?*
(parameter/c equivalence/c)]
[cachefile
(-> path-string? parent-directory-exists?)]
[with-cache
(->* [parent-directory-exists? (-> any)]
[#:use-cache? boolean?
#:fasl? boolean?
#:keys keys/c
#:keys-equal? equivalence/c
#:read (-> any/c any)
#:write (-> any/c any)]
any)]))