File tree Expand file tree Collapse file tree 2 files changed +30
-5
lines changed
typed-racket-lib/typed-racket/base-env
typed-racket-test/succeed Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 7474 ;; unsafe-normalise-inputs
7575 [(make-template-identifier 'unsafe-normalise-inputs 'racket/private/for )
7676 (-poly (a)
77- (-> (-> a -Nat) a -Nat (Un (-val #f ) -Nat ) -Nat (-values (list a -Index -Index -Index))))]
77+ (-> (-> a -Nat) a -Nat (Un (-val #f ) -Int ) -Int (-values (list a -Index -Index -Index))))]
7878 ;; normalise-inputs
7979 [(make-template-identifier 'normalise-inputs 'racket/private/for )
8080 (-poly (a)
81- (-> -Symbol -String (-> a -Boolean) (-> a -Nat) a -Nat (Un (-val #f ) -Nat ) -Nat (-values (list a -Index -Index -Index))))]
81+ (-> -Symbol -String (-> a -Boolean) (-> a -Nat) a -Nat (Un (-val #f ) -Int ) -Int (-values (list a -Index -Index -Index))))]
8282 ;; make-sequence
8383 [(make-template-identifier 'make-sequence 'racket/private/for )
8484 (-polydots (a b)
366366 (-> -Variable-Reference -Module-Path -Resolved-Module-Path)]
367367 ;; in-fxvector, in-flvector, in-extflvector
368368 [(make-template-identifier 'in-fxvector* 'racket/fixnum )
369- (-> -FxVector (-seq -Fixnum))]
369+ (->opt -FxVector [-Int (-opt -Int) -Int] (-seq -Fixnum))]
370370 [(make-template-identifier 'in-flvector* 'racket/flonum )
371- (-> -FlVector (-seq -Flonum))]
371+ (->opt -FlVector [-Int (-opt -Int) -Int] (-seq -Flonum))]
372372 [(make-template-identifier 'in-extflvector* 'racket/extflonum )
373- (-> -ExtFlVector (-seq -ExtFlonum))]
373+ (->opt -ExtFlVector [-Int (-opt -Int) -Int] (-seq -ExtFlonum))]
374374 [(make-template-identifier 'make-namespace-anchor 'racket/private/namespace )
375375 (-> -Variable-Reference -Namespace-Anchor)]
376376 [(make-template-identifier 'check-logger-or-false 'racket/private/logger )
Original file line number Diff line number Diff line change 1+ #lang typed/racket/base
2+
3+ (require racket/sequence
4+ racket/flonum
5+ racket/fixnum
6+ racket/extflonum
7+ typed/rackunit)
8+
9+ (check-equal? (sequence->list (in-flvector (flvector 1.0 2.0 3.0 4.0 ))) (list 1.0 2.0 3.0 4.0 ))
10+ (check-equal? (sequence->list (in-flvector (flvector 1.0 2.0 3.0 4.0 ) 1 )) (list 2.0 3.0 4.0 ))
11+ (check-equal? (sequence->list (in-flvector (flvector 1.0 2.0 3.0 4.0 ) 1 2 )) (list 2.0 ))
12+ (check-equal? (sequence->list (in-flvector (flvector 1.0 2.0 3.0 4.0 ) 0 #f 2 )) (list 1.0 3.0 ))
13+ (check-equal? (for/list : (Listof Flonum) ([i (in-flvector (flvector 1.0 2.0 3.0 4.0 ) 3 -1 -2 )]) i)
14+ (list 4.0 2.0 ))
15+
16+ (check-equal? (sequence->list (in-fxvector (fxvector 1 2 3 4 ) 0 #f 2 )) (list 1 3 ))
17+ (check-equal? (for/list : (Listof Fixnum) ([i : Fixnum (ann (in-fxvector (fxvector 1 2 3 4 ) 3 -1 -2 ) (Sequenceof Fixnum))]) i)
18+ (list 4 2 ))
19+ ;; I don't understand why this fails...
20+ #; (check-equal? (for/list : (Listof Fixnum) ([i (in-fxvector (fxvector 1 2 3 4 ) 3 -1 -2 )]) i)
21+ (list 4 2 ))
22+
23+ (when (extflonum-available?)
24+ (check-equal? (for/list : (Listof ExtFlonum) ([i (in-extflvector (extflvector 1.0t0 2.0t0 3.0t0 4.0t0 ) 3 -1 -2 )]) i)
25+ (list 4.0t0 2.0t0 )))
You can’t perform that action at this time.
0 commit comments