(module type-env mzscheme
(require (lib "boundmap.ss" "syntax")
"tc-utils.ss")
(provide register-type
lookup-type
register-types
type-env-map)
(define the-mapping (make-module-identifier-mapping))
(define (register-type id type)
(printf "registering ~a~n" (syntax-object->datum id))
(module-identifier-mapping-put! the-mapping id type))
(define (register-types ids types)
(for-each register-type ids types))
(define (lookup-type id)
(printf "looking up ~a~n" (syntax-e id))
(module-identifier-mapping-get the-mapping id (lambda () (lookup-fail (syntax-e id)))))
(define (type-env-map f)
(module-identifier-mapping-map the-mapping f))
)