Add back some special cases.
This commit is contained in:
parent
21598297a7
commit
7eaae20f41
|
@ -34,9 +34,17 @@
|
||||||
[(Union: es) es]
|
[(Union: es) es]
|
||||||
[_ (list t)]))
|
[_ (list t)]))
|
||||||
|
|
||||||
|
(define empty-union (make-Union null))
|
||||||
|
|
||||||
;; Union constructor
|
;; Union constructor
|
||||||
;; Normalizes representation by sorting types.
|
;; Normalizes representation by sorting types.
|
||||||
;; Type * -> Type
|
;; Type * -> Type
|
||||||
;; The input types can overlap and be union types
|
;; The input types can overlap and be union types
|
||||||
(define (Un . args)
|
(define Un
|
||||||
(make-union* (foldr merge '() (remove-dups (sort (append-map flat args) type<?)))))
|
(case-lambda
|
||||||
|
[() empty-union]
|
||||||
|
[(t) t]
|
||||||
|
[args
|
||||||
|
(define ts (foldr merge '()
|
||||||
|
(remove-dups (sort (append-map flat args) type<?))))
|
||||||
|
(make-union* ts)]))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user