(define impc:ti:type-clean
(lambda (type)
(if (or (null? type)
(atom? type)
(impc:ir:type? type)) ;; (note to andrew) remove this line for GC crash!
type
(map (lambda (k)
(if (list? k)
(if (= (length k) 1)
(impc:ti:type-clean (car k))
(impc:ti:type-clean k))
k))
type))))