From c6fb95d44d2869baa2f53f3f8dba04b19620da81 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Thu, 8 Jul 2010 16:11:46 -0400 Subject: [PATCH] add `make-constant' --- collects/typed-scheme/rep/free-variance.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/collects/typed-scheme/rep/free-variance.rkt b/collects/typed-scheme/rep/free-variance.rkt index 3e9471d9a7..db8f0e63d1 100644 --- a/collects/typed-scheme/rep/free-variance.rkt +++ b/collects/typed-scheme/rep/free-variance.rkt @@ -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))