File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 34
34
(define-syntax ~Type*
35
35
(pattern-expander
36
36
(syntax-parser
37
- [:id #'(~Type _ )]
38
- [(_ n) #'(~Type n)]))))
37
+ [:id
38
+ #'(~and b
39
+ (~parse (~Type _ )
40
+ ((current-type-eval) #'b )))]
41
+ [(_ n)
42
+ #'(~and b
43
+ (~parse (~Type n)
44
+ ((current-type-eval) #'b )))]))))
39
45
40
46
(define-typed-syntax Type
41
47
[:id ≫ --- [≻ (Type 0 )]]
61
67
62
68
(define-typed-syntax Π
63
69
; Check
64
- [(_ (x:id (~datum :) A) B) ⇐ (~Type n:nat) ≫
70
+ [(_ (x:id (~datum :) A) B) ⇐ (~Type* n:nat) ≫
65
71
[⊢ A ≫ A- ⇐ (Type n)]
66
72
[[x ≫ x-- : A-] ⊢ B ≫ B- ⇐ (Type n)]
67
73
; TODO: Oh look a pattern. Should be built into [x >> x-] form, or something.
85
91
86
92
[(_ (x:id (~datum :) A) B) ≫
87
93
; NB: Expect a type of arbitrary level, for better errors
88
- [⊢ A ≫ A- ⇒ (~or (~Type n:nat) U₁)]
89
- [[x ≫ x-- : A-] ⊢ B ≫ B- ⇒ (~or (~Type m:nat) U₂)]
94
+ [⊢ A ≫ A- ⇒ (~or (~Type* n:nat) U₁)]
95
+ [[x ≫ x-- : A-] ⊢ B ≫ B- ⇒ (~or (~Type* m:nat) U₂)]
90
96
#:fail-unless (attribute n)
91
97
(type-error #:src #'A- #:msg "expected (Type n) (for some n), given ~a " #'U₁ )
92
98
#:fail-unless (attribute m)
You can’t perform that action at this time.
0 commit comments