Remove references to unstable/match
from Typed Racket.
This commit is contained in:
parent
9b29dcb9a7
commit
aba4def03c
|
@ -5,7 +5,7 @@
|
||||||
(for-template racket/base)
|
(for-template racket/base)
|
||||||
(private with-types type-contract parse-type syntax-properties)
|
(private with-types type-contract parse-type syntax-properties)
|
||||||
(except-in syntax/parse id)
|
(except-in syntax/parse id)
|
||||||
racket/match racket/syntax unstable/match racket/list syntax/stx
|
racket/match racket/syntax racket/list syntax/stx
|
||||||
racket/format
|
racket/format
|
||||||
racket/promise
|
racket/promise
|
||||||
(only-in racket/string string-join)
|
(only-in racket/string string-join)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(require unstable/match racket/match unstable/sequence unstable/syntax
|
(require racket/match unstable/sequence unstable/syntax
|
||||||
racket/dict syntax/id-table racket/syntax syntax/stx
|
racket/dict syntax/id-table racket/syntax syntax/stx
|
||||||
"../utils/utils.rkt"
|
"../utils/utils.rkt"
|
||||||
(for-template racket/base)
|
(for-template racket/base)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
(types resolve utils)
|
(types resolve utils)
|
||||||
(prefix-in t: (types abbrev numeric-tower))
|
(prefix-in t: (types abbrev numeric-tower))
|
||||||
(private parse-type syntax-properties)
|
(private parse-type syntax-properties)
|
||||||
racket/match unstable/match syntax/struct syntax/stx racket/syntax racket/list
|
racket/match syntax/struct syntax/stx racket/syntax racket/list
|
||||||
unstable/sequence
|
unstable/sequence
|
||||||
(contract-req)
|
(contract-req)
|
||||||
(for-template racket/base racket/contract racket/set (utils any-wrap)
|
(for-template racket/base racket/contract racket/set (utils any-wrap)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
(require (except-in "../utils/utils.rkt" infer)
|
(require (except-in "../utils/utils.rkt" infer)
|
||||||
racket/match unstable/match racket/function racket/lazy-require racket/list
|
racket/match racket/function racket/lazy-require racket/list
|
||||||
(prefix-in c: (contract-req))
|
(prefix-in c: (contract-req))
|
||||||
(rep type-rep filter-rep object-rep rep-utils)
|
(rep type-rep filter-rep object-rep rep-utils)
|
||||||
(utils tc-utils)
|
(utils tc-utils)
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
(prefix-in c: (contract-req))
|
(prefix-in c: (contract-req))
|
||||||
(types subtype base-abbrev resolve)
|
(types subtype base-abbrev resolve)
|
||||||
racket/match
|
racket/match
|
||||||
racket/list
|
racket/list)
|
||||||
(only-in unstable/match match*?))
|
|
||||||
|
|
||||||
|
|
||||||
(provide/cond-contract
|
(provide/cond-contract
|
||||||
|
@ -24,19 +23,18 @@
|
||||||
;; The output is a non overlapping list of non Union types.
|
;; The output is a non overlapping list of non Union types.
|
||||||
(define (merge a b)
|
(define (merge a b)
|
||||||
(define b* (make-union* b))
|
(define b* (make-union* b))
|
||||||
(cond
|
(match* (a b)
|
||||||
;; If a union element is a Name application, then it should not
|
;; If a union element is a Name application, then it should not
|
||||||
;; be checked for subtyping since that can cause infinite
|
;; be checked for subtyping since that can cause infinite
|
||||||
;; loops if this is called during type instantiation.
|
;; loops if this is called during type instantiation.
|
||||||
[(match*? (a b) ((App: (? Name?) _ _) b))
|
[((App: (and (Name: _) rator) rands stx) _)
|
||||||
(match-define (App: rator rands stx) a)
|
|
||||||
;; However, we should check if it's a well-formed application
|
;; However, we should check if it's a well-formed application
|
||||||
;; so that bad applications are rejected early.
|
;; so that bad applications are rejected early.
|
||||||
(resolve-app-check-error rator rands stx)
|
(resolve-app-check-error rator rands stx)
|
||||||
(cons a b)]
|
(cons a b)]
|
||||||
[(subtype a b*) b]
|
[((? (λ _ (subtype a b*))) _) b]
|
||||||
[(subtype b* a) (list a)]
|
[((? (λ _ (subtype b* a))) _) (list a)]
|
||||||
[else (cons a b)]))
|
[(_ _) (cons a b)]))
|
||||||
|
|
||||||
;; Type -> List[Type]
|
;; Type -> List[Type]
|
||||||
(define (flat t)
|
(define (flat t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user