Skip to content

Commit ed9d035

Browse files
authored
fix the types fo LVof (#99)
change those types to be forward-compatible with TR's upcoming changes where polymorphic types are no longer replacements of type constructors
1 parent 6743d6b commit ed9d035

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

plot-lib/plot/private/plot2d/arrows.rkt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444

4545
;(Sequenceof (Sequence (Sequenceof Real))) does not work because (sequence? 5) = #t
4646
;and so the contract can not know if '((2 2)) is three or two nested sequences
47-
(define-type LVof (All (A) (U (Listof A) (Vectorof A))))
47+
(define-type (LVof A)
48+
(U (Listof A) (Vectorof A)))
49+
4850
(:: arrows
4951
(->* [(U (LVof (LVof Real))
5052
(LVof (LVof (LVof Real))))]
@@ -113,7 +115,7 @@
113115
[v2 (in-list (cdr S1*))])
114116
(cons v1 v2))]
115117
[else S2]))
116-
118+
117119
;; calculate bound and pick right render-fun
118120
(define rvs
119121
(let ()
@@ -139,4 +141,4 @@
139141
(values (if x-min x-min (apply min* rxs))
140142
(if x-max x-max (apply max* rxs))
141143
(if y-min y-min (apply min* rys))
142-
(if y-max y-max (apply max* rys))))
144+
(if y-max y-max (apply max* rys))))

plot-lib/plot/private/plot3d/arrows.rkt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
(send area put-arrow (car x) (cdr x) #t))))
3232

3333

34-
(define-type LVof (All (A) (U (Listof A)(Vectorof A))))
34+
(define-type (LVof A)
35+
(U (Listof A) (Vectorof A)))
36+
3537
(:: arrows3d
3638
(->* [(U (LVof (LVof Real))
3739
(LVof (LVof (LVof Real))))]
@@ -74,7 +76,7 @@
7476
'arrows3d
7577
"(U (Sequenceof (Sequence Real Real Real)) (Sequenceof (Sequence (Sequence Real Real Real) (Sequence Real Real Real))))"
7678
vs))
77-
79+
7880
;; check if we have head/tail or pair vectors, and put in standard format
7981
(define-values (S1 S2)
8082
(for/fold ([S1 : (Listof (Vectorof Real)) '()]
@@ -135,4 +137,4 @@
135137
(if y-min y-min (apply min* rys))
136138
(if y-max y-max (apply max* rys))
137139
(if z-min z-min (apply min* rzs))
138-
(if z-max z-max (apply max* rzs))))
140+
(if z-max z-max (apply max* rzs))))

0 commit comments

Comments
 (0)