Fix tests where type variable scoping is wrong

original commit: 28108884ab90dfe29f721dcee8575afd7d1a7f5b
This commit is contained in:
Asumu Takikawa 2012-12-12 14:01:34 -05:00
parent e8fc1ce747
commit e1799227f0
5 changed files with 13 additions and 13 deletions

View File

@ -92,9 +92,9 @@
(define: mymap : (All (a b) ((a -> b) (Listof a) -> (Listof b)))
(plambda: (a b) ([f : (a -> b)] [l : (Listof a)])
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(mymap add1 (cons 1 (cons 2 (cons 3 #{'() :: (Listof number)}))))

View File

@ -207,7 +207,7 @@
(define: list->heap : (All (a) (case-lambda (comparator (list-of a) -> (Heap a)) ((list-of a) -> (Heap a))))
; time: O(n)
(pcase-lambda: (a)
(pcase-lambda: (a)
[([l : (list-of a)]) (list->heap (current-compare) l)]
[([cmp : comparator] [l : (list-of a)])
(let* ([e (#{empty @ a} cmp)]

View File

@ -357,9 +357,9 @@
;; FIXME
(define: mymap : (All (a b) ((a -> b) (list-of a) -> (list-of b)))
(plambda: (a b) ([f : (a -> b)] [l : (list-of a)])
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(mymap add1 (cons 1 (cons 2 (cons 3 '()))))

View File

@ -7,9 +7,9 @@
#;(require "prims.rkt")
(define: mymap : (All (a b) ((a -> b) (list-of a) -> (list-of b)))
(plambda: (a b) ([f : (a -> b)] [l : (list-of a)])
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(cond [(null? l) '()]
[else (cons (f (car l))
(mymap f (cdr l)))])))
(pdefine: (a b) (mymap2 [f : (a -> b)] [l : (list-of a)]) : (list-of b)
(cond [(null? l) '()]

View File

@ -54,9 +54,9 @@
(define: empty : (All (a) (case-lambda (-> (priority-queue a)) (comparator -> (priority-queue a))))
(pcase-lambda: (a)
[() (#{empty @ a} (current-compare))]
[([cmp : comparator]) (make (#{heap:empty :: (case-lambda (-> (pqh a))
(comparator -> (pqh a)))} cmp))]))
[() (#{empty @ a} (current-compare))]
[([cmp : comparator]) (make (#{heap:empty :: (case-lambda (-> (pqh a))
(comparator -> (pqh a)))} cmp))]))
(pdefine: (e r) (fold [f : ((cons number e) r -> r)] [b : r] [a : (priority-queue e)]) : r
(heap:fold f b (#{heap :: ((priority-queue e) -> (pqh e))} a)))