Skip to content

Commit 46044d3

Browse files
author
Andrew Kent
committed
fix fix printing
1 parent db3b6d2 commit 46044d3

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

typed-racket-lib/typed-racket/env/init-envs.rkt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@
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)])

typed-racket-lib/typed-racket/rep/type-rep.rkt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
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:
@@ -1522,13 +1522,15 @@
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

typed-racket-lib/typed-racket/types/printer.rkt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@
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)])
@@ -717,7 +719,8 @@
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=?))

0 commit comments

Comments
 (0)