Fix call/comp's type

original commit: 3f2d4663a87939a02223b6620407e25b0507aa4a
This commit is contained in:
Asumu Takikawa 2012-12-04 14:02:55 -05:00
parent 50713b7368
commit a0c32ff288
3 changed files with 26 additions and 4 deletions

View File

@ -0,0 +1,17 @@
#lang typed/racket
(require racket/control)
(: tag (Prompt-Tagof Integer (Integer -> Integer)))
(define tag (make-continuation-prompt-tag))
(call-with-continuation-prompt
(λ ()
(+ 1
((inst call-with-composable-continuation Integer (Integer -> Integer)
Integer)
(lambda: ([k : (Integer -> Integer)]) (k 1))
tag)))
tag
(λ: ([x : Integer]) (+ 1 x)))

View File

@ -14,7 +14,8 @@
;; Test call/comp & abort
(call-with-continuation-prompt
(λ () (+ 1 (call-with-composable-continuation
(λ () (+ 1 ((inst call-with-composable-continuation
Integer ((Integer -> Integer) -> Integer) Integer)
(λ: ([k : (Integer -> Integer)])
(abort-current-continuation pt2 k))
pt2)))

View File

@ -2036,9 +2036,13 @@
[call/cc (-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]
[call-with-composable-continuation
(-polydots (b c a)
(cl->*
(-> (->... '() (a a) b) (make-Prompt-Tagof b c)
(make-ValuesDots '() a 'a))))]
(-> ;; takes a continuation and should return the same
;; type as the continuation's input type
(-> (->... '() (a a) b) (make-ValuesDots '() a 'a))
(make-Prompt-Tagof b c)
;; the continuation's input is the same as the
;; return type here
(make-ValuesDots '() a 'a)))]
[call-with-escape-continuation
(-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]
[call/ec (-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]