checkpoint: example fix for msgpack failure
This commit is contained in:
parent
2ef852ae91
commit
6cffbfa6d8
|
@ -160,10 +160,10 @@
|
|||
((vectorof/sc (#:invariant)) vectorof #:chaperone)
|
||||
((promise/sc (#:covariant)) promise-not-name/c #:chaperone)
|
||||
((syntax/sc (#:covariant #:flat)) syntax/c #:flat)
|
||||
((hash/sc (#:invariant #:flat) (#:invariant)) hash/c #:chaperone)
|
||||
((mutable-hash/sc (#:invariant #:flat) (#:invariant)) mutable-hash/c #:chaperone)
|
||||
((immutable-hash/sc (#:covariant #:flat) (#:covariant)) immutable-hash/c #:flat)
|
||||
((weak-hash/sc (#:invariant #:flat) (#:invariant)) weak-hash/c #:chaperone)
|
||||
((hash/sc (#:invariant) (#:invariant)) tr-hash/c #:chaperone)
|
||||
((mutable-hash/sc (#:invariant) (#:invariant)) mutable-hash/c #:chaperone)
|
||||
((immutable-hash/sc (#:covariant) (#:covariant)) immutable-hash/c #:flat)
|
||||
((weak-hash/sc (#:invariant) (#:invariant)) weak-hash/c #:chaperone)
|
||||
((box/sc (#:invariant)) box/c #:chaperone)
|
||||
((parameter/sc (#:contravariant) (#:covariant)) parameter/c #:chaperone)
|
||||
((sequence/sc . (#:covariant)) sequence/c #:impersonator)
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
#lang racket/base
|
||||
|
||||
(require racket/contract)
|
||||
(provide mutable-hash/c immutable-hash/c weak-hash/c)
|
||||
(provide tr-hash/c mutable-hash/c immutable-hash/c weak-hash/c)
|
||||
|
||||
(define (mutable-hash/c k v) (and/c hash? (not/c hash-weak?) (hash/c k v #:immutable #f)))
|
||||
(define (immutable-hash/c k v) (hash/c k v #:immutable #t))
|
||||
(define (weak-hash/c k v) (and/c hash? hash-weak? (hash/c k v #:immutable #f)))
|
||||
(define (mutable-hash/c k v)
|
||||
(and/c hash? (not/c hash-weak?) (tr-hash/c k v #:immutable #f)))
|
||||
|
||||
(define (immutable-hash/c k v)
|
||||
(tr-hash/c k v #:immutable #t))
|
||||
|
||||
(define (weak-hash/c k v)
|
||||
(and/c hash? hash-weak? (tr-hash/c k v #:immutable #f)))
|
||||
|
||||
(define (tr-hash/c k v #:immutable [immutable 'dont-care])
|
||||
(if (flat-contract? k)
|
||||
(hash/c k v #:immutable immutable)
|
||||
(and/c hash? hash-equal? (hash/c k v #:immutable immutable))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user