File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
typed-racket-lib/typed-racket Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 264264 `(make-Opaque (quote-syntax ,pred))]
265265 [(Refinement: parent pred)
266266 `(make-Refinement ,(type->sexp parent) (quote-syntax ,pred))]
267- [(Mu-name: n b)
267+ [(Mu-maybe-name: n (? Type? b))
268+ `(make-Mu (quote ,n) ,(type->sexp b))]
269+ [(Mu: n b)
268270 `(make-Mu (quote ,n) ,(type->sexp b))]
269271 [(Poly-names: ns b)
270272 `(make-Poly (list ,@(for/list ([n (in-list ns)])
Original file line number Diff line number Diff line change 3232 "base-union.rkt " )
3333 Type Prop Object PathElem SomeValues)
3434 Type?
35- Mu-name:
35+ Mu-maybe- name:
3636 Poly-names: Poly-fresh:
3737 PolyDots-names:
3838 PolyRow-names: PolyRow-fresh:
15221522 (list sym (Mu-body* sym t))))
15231523 (list np bp)))])))
15241524
1525- (define-match-expander Mu-name:
1525+ (define-match-expander Mu-maybe- name:
15261526 (lambda (stx)
15271527 (syntax-case stx ()
15281528 [(_ np bp)
15291529 #'(? Mu?
1530- (app (lambda (t) (let ([sym (hash-ref type-var-name-table t (lambda _ (gensym)))])
1531- (list sym (Mu-body* sym t))))
1530+ (app (lambda (t) (let ([sym (hash-ref type-var-name-table t #f )])
1531+ (if sym
1532+ (list sym (Mu-body* sym t))
1533+ (list #f #f ))))
15321534 (list np bp)))])))
15331535
15341536;; These match expanders correspond to opening up a type in
Original file line number Diff line number Diff line change 686686 #t ]
687687 [_ #f ])))
688688 'Syntax ]
689+ [(Mu-maybe-name: name (? Type? body))
690+ `(Rec ,name ,(t->s body))]
689691 [(Mu-unsafe: raw-body)
690692 (with-printable-names 1 name-ids
691693 (let ([names (for/list ([id (in-list name-ids)])
717719 name]
718720 [(DepFun: raw-dom raw-pre raw-rng)
719721 (with-printable-names (length raw-dom) ids
720- (define dom (instantiate-obj raw-dom ids))
722+ (define dom (for/list ([d (in-list raw-dom)])
723+ (instantiate-obj d ids)))
721724 (define pre (instantiate-obj raw-pre ids))
722725 (define rng (instantiate-obj raw-rng ids))
723726 (define (arg-id? id) (member id ids free-identifier=?))
You can’t perform that action at this time.
0 commit comments