Actually fix all of the contract errors in substitute.rkt

original commit: 79df0996fdd0b2f4e09afdc5f4d41fb739805d34
This commit is contained in:
Eric Dobson 2014-05-12 08:08:46 -07:00
parent cfdf846d76
commit bbf3ab9655

View File

@ -39,7 +39,8 @@
;; substitute-many : Hash[Name,Type] Type -> Type
(define/cond-contract (substitute-many subst target #:Un [Un (lambda (args) (apply Un args))])
((simple-substitution/c (or/c Values/c arr?)) (#:Un procedure?) . ->* . (or/c Values/c arr?))
((simple-substitution/c (or/c SomeValues/c Values/c arr?)) (#:Un procedure?)
. ->* . (or/c SomeValues/c Values/c arr?))
(define (sb t) (substitute-many subst t #:Un Un))
(define names (hash-keys subst))
(define fvs (free-vars* target))
@ -88,7 +89,8 @@
;; implements angle bracket substitution from the formalism
;; substitute-dots : Listof[Type] Option[type] Name Type -> Type
(define/cond-contract (substitute-dots images rimage name target)
((listof Type/c) (or/c #f Type/c) symbol? (or/c arr? Values/c) . -> . (or/c arr? Values/c))
((listof Type/c) (or/c #f Type/c) symbol? (or/c arr? SomeValues/c Values/c)
. -> . (or/c arr? SomeValues/c Values/c))
(define (sb t) (substitute-dots images rimage name t))
(if (or (set-member? (free-vars-names (free-idxs* target)) name)
(set-member? (free-vars-names (free-vars* target)) name))