From f850aa09190efe1548ea3b9e301d01b1a00f1f48 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Wed, 18 Jun 2014 21:11:07 -0700 Subject: [PATCH] Change typelist (struct->vector v))) (list-rest tag seq fv fi stx key vals))) vals])) +;; Rep equality and inequality +(define (rep-equal? s t) + (eq? (Rep-seq s) (Rep-seq t))) +(define (rep . boolean?)] + [rename rep . boolean?)] + [rename rep . boolean?)] + [struct Rep ([seq exact-nonnegative-integer?] + [free-vars (hash/c symbol? variance?)] + [free-idxs (hash/c symbol? variance?)] + [stx (or/c #f syntax?)])]) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/rep/type-rep.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/rep/type-rep.rkt index 70e9f182..75c1378c 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/rep/type-rep.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/rep/type-rep.rkt @@ -29,7 +29,7 @@ PolyDots-n Class? Row? Row: free-vars* - type-compare type . boolean?)]) ;; Ugly hack - should use units (lazy-require @@ -579,21 +578,6 @@ [(Scope: sc*) (remove-scopes (sub1 n) sc*)] [_ (int-err "Tried to remove too many scopes: ~a" sc)]))) -;; type equality -(define/cond-contract (type-equal? s t) - (Rep? Rep? . -> . boolean?) - (eq? (Rep-seq s) (Rep-seq t))) - -;; inequality - good -(define/cond-contract (type . boolean?) - (< (Rep-seq s) (Rep-seq t))) - -(define/cond-contract (type-compare s t) - (Rep? Rep? . -> . (or/c -1 0 1)) - (cond [(type-equal? s t) 0] - [(type