add `make-constant'

This commit is contained in:
Sam Tobin-Hochstadt 2010-07-08 16:11:46 -04:00
parent 898c92eb1e
commit c6fb95d44d

View File

@ -6,7 +6,7 @@
(provide Covariant Contravariant Invariant Constant Dotted
combine-frees flip-variances without-below unless-in-table
fix-bound make-invariant variance?)
fix-bound make-invariant make-constant variance?)
;; this file contains support for calculating the free variables/indexes of types
;; actual computation is done in rep-utils.rkt and type-rep.rkt
@ -61,6 +61,10 @@
(for/hasheq ([(k v) (in-hash vs)])
(values k Invariant)))
(define (make-constant vs)
(for/hasheq ([(k v) (in-hash vs)])
(values k Constant)))
(define (without-below n frees)
(for/hasheq ([(k v) (in-hash frees)]
#:when (>= k n))