Add failure cases.

original commit: 88cbe6387952e9da5e57c46c9977a15702e41b82
This commit is contained in:
Sam Tobin-Hochstadt 2008-07-07 14:49:19 -04:00
parent cc2b39add3
commit 760559a6db
2 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1,16 @@
#;
(exn-pred 2)
#lang typed-scheme
(require typed-scheme/private/extra-procs)
(: map-with-funcs (All (b ...) ((b ... b -> b) ... b -> (b ... b -> (values b ... b)))))
(define (map-with-funcs . fs)
(lambda bs
(apply values* (map (lambda: ([f : (b ... b -> b)])
(apply f bs)) fs))))
(map-with-funcs (lambda () 1))
(map-with-funcs (lambda: ([x : Integer] [y : Integer] . [z : Integer *])
(+ x y)))

View File

@ -16,12 +16,13 @@
(apply values* (map (lambda: ([f : (b ... b -> b)])
(apply f bs)) fs))))
#;(map-with-funcs + - * /)
(map-with-funcs + - * /)
(inst map-with-funcs Integer Integer)
#;(map-with-funcs (lambda: ([x : Integer] [y : Integer]) (+ x y))
(lambda: ([x : Integer] [y : Integer]) (- x y)))
(map-with-funcs
(lambda: ([x : Integer] [y : Integer]) (+ x y))
(lambda: ([x : Integer] [y : Integer]) (- x y)) )
(((inst map-with-funcs Integer Integer)
(lambda: ([x : Integer] [y : Integer]) (+ x y))