typed-racket/typed-racket-test/fail/ann-map-funcs.rkt
2014-12-16 10:07:25 -05:00

18 lines
433 B
Racket

#;
(exn-pred 3)
#lang typed-scheme
(: map-with-funcs (All (b a ...) ((a ... a -> b) * -> (a ... a -> (Listof b)))))
(define (map-with-funcs . fs)
(lambda as
(map (lambda: ([f : (a ... a -> b)])
(apply f as))
fs)))
(ann (map-with-funcs + - * /) (Number Number * -> (Listof Integer)))
(ann (map-with-funcs + - * /) (Number * -> (Listof Number)))
(ann (map-with-funcs + - * /) (Integer * -> (Listof Number)))