(define-macro (constrain-genericfunc sym . args)
(apply impc:ti:constrain-genericfunc
(symbol->string sym)
(map (lambda (x)
(if (regex:match? (symbol->string x) "^\\$")
(set! x (string->symbol (string-append (symbol->string sym) ":" (symbol->string x)))))
(symbol->string (impc:ti:expand-generic-type x))) args)))