diff --git a/collects/tests/racket/benchmarks/shootout/typed/nbody-generic.rktl b/collects/tests/racket/benchmarks/shootout/typed/nbody-generic.rktl index 25287c5d0a..f00fd9504a 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/nbody-generic.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/nbody-generic.rktl @@ -76,8 +76,7 @@ Correct output N = 1000 is ;; ------------------------------- (: offset-momentum ( -> Void)) (define (offset-momentum) - (let: loop-i : Void ([i : (Listof body) *system*] - [px : Float 0.0] [py : Float 0.0] [pz : Float 0.0]) + (let loop-i ([i *system*] [px 0.0] [py 0.0] [pz 0.0]) (if (null? i) (begin (set-body-vx! (car *system*) (/ (- px) +solar-mass+)) @@ -92,7 +91,7 @@ Correct output N = 1000 is ;; ------------------------------- (: energy ( -> Float)) (define (energy) - (let: loop-o : Float ([o : (Listof body) *system*] [e : Float 0.0]) + (let loop-o ([o *system*] [e 0.0]) (if (null? o) e (let* ([o1 (car o)] diff --git a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-generic.rktl b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-generic.rktl index 2347175320..a7844c0991 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-generic.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-generic.rktl @@ -85,8 +85,7 @@ Correct output N = 1000 is ;; ------------------------------- (: offset-momentum ( -> Void)) (define (offset-momentum) - (let: loop-i : Void ([i : Natural 0] - [px : Float 0.0] [py : Float 0.0] [pz : Float 0.0]) + (let loop-i ([i 0] [px 0.0] [py 0.0] [pz 0.0]) (if (= i *system-size*) (begin (set-body-vx! (vector-ref *system* 0) (/ (- px) +solar-mass+)) @@ -101,7 +100,7 @@ Correct output N = 1000 is ;; ------------------------------- (: energy ( -> Float)) (define (energy) - (let: loop-o : Float ([o : Natural 0] [e : Float 0.0]) + (let loop-o ([o 0] [e 0.0]) (if (= o *system-size*) e (let* ([o1 (vector-ref *system* o)] diff --git a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-unsafe.rktl b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-unsafe.rktl index c5679d68ff..a57e1ff568 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-unsafe.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec-unsafe.rktl @@ -90,8 +90,7 @@ Correct output N = 1000 is ;; ------------------------------- (: offset-momentum ( -> Void)) (define (offset-momentum) - (let: loop-i : Void ([i : Natural 0] - [px : Float 0.0] [py : Float 0.0] [pz : Float 0.0]) + (let loop-i ([i 0] [px 0.0] [py 0.0] [pz 0.0]) (if (unsafe-fx= i *system-size*) (begin (set-body-vx! (unsafe-vector-ref *system* 0) (fl/ (fl- 0.0 px) +solar-mass+)) @@ -106,7 +105,7 @@ Correct output N = 1000 is ;; ------------------------------- (: energy ( -> Float)) (define (energy) - (let: loop-o : Float ([o : Natural 0] [e : Float 0.0]) + (let loop-o ([o 0] [e 0.0]) (if (unsafe-fx= o *system-size*) e (let* ([o1 (unsafe-vector-ref *system* o)] diff --git a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec.rktl b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec.rktl index f133e32f3b..fe78b7b436 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/nbody-vec.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/nbody-vec.rktl @@ -85,8 +85,7 @@ Correct output N = 1000 is ;; ------------------------------- (: offset-momentum ( -> Void)) (define (offset-momentum) - (let: loop-i : Void ([i : Natural 0] - [px : Float 0.0] [py : Float 0.0] [pz : Float 0.0]) + (let loop-i ([i 0] [px 0.0] [py 0.0] [pz 0.0]) (if (= i *system-size*) (begin (set-body-vx! (vector-ref *system* 0) (fl/ (fl- 0.0 px) +solar-mass+)) @@ -101,7 +100,7 @@ Correct output N = 1000 is ;; ------------------------------- (: energy ( -> Float)) (define (energy) - (let: loop-o : Float ([o : Natural 0] [e : Float 0.0]) + (let loop-o ([o 0] [e 0.0]) (if (= o *system-size*) e (let* ([o1 (vector-ref *system* o)] diff --git a/collects/tests/racket/benchmarks/shootout/typed/nbody.rktl b/collects/tests/racket/benchmarks/shootout/typed/nbody.rktl index 12caa20d20..9828756499 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/nbody.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/nbody.rktl @@ -77,8 +77,7 @@ Correct output N = 1000 is ;; ------------------------------- (: offset-momentum ( -> Void)) (define (offset-momentum) - (let: loop-i : Void ([i : (Listof body) *system*] - [px : Float 0.0] [py : Float 0.0] [pz : Float 0.0]) + (let loop-i ([i *system*] [px 0.0] [py 0.0] [pz 0.0]) (if (null? i) (begin (set-body-vx! (car *system*) (fl/ (fl- 0.0 px) +solar-mass+)) @@ -93,7 +92,7 @@ Correct output N = 1000 is ;; ------------------------------- (: energy ( -> Float)) (define (energy) - (let: loop-o : Float ([o : (Listof body) *system*] [e : Float 0.0]) + (let loop-o ([o *system*] [e 0.0]) (if (null? o) e (let* ([o1 (car o)] diff --git a/collects/tests/racket/benchmarks/shootout/typed/spectralnorm-unsafe.rktl b/collects/tests/racket/benchmarks/shootout/typed/spectralnorm-unsafe.rktl index 61a990ccb9..ec4bd015a6 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/spectralnorm-unsafe.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/spectralnorm-unsafe.rktl @@ -45,8 +45,8 @@ (define (MultiplyAv n v Av) (for ([i (in-range n)]) (flvector-set! Av i - (for/fold: : Float ([r : Float 0.0]) - ([j : Natural (in-range n)]) + (for/fold ([r 0.0]) + ([j (in-range n)]) (fl+ r (fl* (A i j) (flvector-ref v j))))))) ;; multiply vector v by matrix A transposed @@ -54,8 +54,8 @@ (define (MultiplyAtv n v Atv) (for ([i (in-range n)]) (flvector-set! Atv i - (for/fold: : Float ([r : Float 0.0]) - ([j : Natural (in-range n)]) + (for/fold ([r 0.0]) + ([j (in-range n)]) (fl+ r (fl* (A j i) (flvector-ref v j))))))) ;; multiply vector v by matrix A and then by matrix A transposed diff --git a/collects/tests/racket/benchmarks/shootout/typed/spectralnorm.rktl b/collects/tests/racket/benchmarks/shootout/typed/spectralnorm.rktl index 24d9830743..6d936ffaac 100644 --- a/collects/tests/racket/benchmarks/shootout/typed/spectralnorm.rktl +++ b/collects/tests/racket/benchmarks/shootout/typed/spectralnorm.rktl @@ -18,7 +18,7 @@ ;; B=AtA A multiplied by A transposed ;; v.Bv /(v.v) eigenvalue of v - (let: loop : Float ([i : Natural 0][vBv : Float 0.0][vv : Float 0.0]) + (let loop ([i 0][vBv 0.0][vv 0.0]) (if (= i n) (flsqrt (fl/ vBv vv)) (let ([vi (flvector-ref v i)]) @@ -38,8 +38,8 @@ (define (MultiplyAv n v Av) (for: : Void ([i : Natural (in-range n)]) (flvector-set! Av i - (for/fold: : Float ([r : Float 0.0]) - ([j : Natural (in-range n)]) + (for/fold ([r 0.0]) + ([j (in-range n)]) (fl+ r (fl* (A i j) (flvector-ref v j))))))) ;; multiply vector v by matrix A transposed @@ -47,8 +47,8 @@ (define (MultiplyAtv n v Atv) (for: : Void ([i : Natural (in-range n)]) (flvector-set! Atv i - (for/fold: : Float ([r : Float 0.0]) - ([j : Natural (in-range n)]) + (for/fold ([r 0.0]) + ([j (in-range n)]) (fl+ r (fl* (A j i) (flvector-ref v j))))))) ;; multiply vector v by matrix A and then by matrix A transposed diff --git a/collects/typed-scheme/types/convenience.rkt b/collects/typed-scheme/types/convenience.rkt index 2ba838be20..25869544f1 100644 --- a/collects/typed-scheme/types/convenience.rkt +++ b/collects/typed-scheme/types/convenience.rkt @@ -33,6 +33,7 @@ [(Value: 0) -Nat] [(? (lambda (t) (subtype t -Nat))) -Nat] [(? (lambda (t) (subtype t -Integer))) -Integer] + [(? (lambda (t) (subtype t -Flonum))) -Flonum] [(Mu: var (Union: (list (Value: '()) (Pair: _ (F: var))))) t*] [(Pair: t1 (Value: '())) (-lst t1)] [(MPair: t1 (Value: '())) (-mlst t1)]