fix any-wrap/c for promises

This commit is contained in:
Robby Findler 2013-12-18 12:58:37 -06:00
parent ed0a5ae45e
commit 370c4bdce2

View File

@ -1,7 +1,10 @@
#lang racket/base #lang racket/base
(require racket/match racket/contract/base racket/contract/combinator (require racket/match racket/contract/base racket/contract/combinator
racket/promise racket/set) racket/set
(only-in (combine-in racket/private/promise)
promise?
prop:force promise-forcer))
(define undef (letrec ([x x]) x)) (define undef (letrec ([x x]) x))
@ -97,9 +100,15 @@
[_ (fail neg-party v)])) [_ (fail neg-party v)]))
(chaperone-procedure v (lambda args (fail neg-party v))))] (chaperone-procedure v (lambda args (fail neg-party v))))]
[(? promise?) [(? promise?)
;; for promises, just apply Any in the promise (chaperone-struct
(contract (promise/c any-wrap/c) v v
(blame-positive b) (blame-negative b))] promise-forcer
(λ (_ proc)
(chaperone-procedure
proc
(λ (promise)
(values (λ (val) (any-wrap/traverse neg-party val))
promise)))))]
[_ (fail neg-party v)])) [_ (fail neg-party v)]))
(λ (v) (λ (neg-party) (any-wrap/traverse neg-party v)))) (λ (v) (λ (neg-party) (any-wrap/traverse neg-party v))))