-
Notifications
You must be signed in to change notification settings - Fork 2
/
exp-elab.txt
101 lines (89 loc) · 2.14 KB
/
exp-elab.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;ideal annotation:
(let [f (ann (fn [f]
(fn [g]
(f g)))
(Rec [r]
[r :-> [r :-> r]]))]
((f f) f))
;actual annotation:
(let [f (ann (fn [f]
(fn [g]
(f g)))
(Rec [r]
(IFn [r :-> (U (IFn) [r :-> (IFn)])])))]
((f f) f))
n = 1
(let [f (fn [f]
(fn [g]
(f g)))]
(f f))
((ann (fn [f] (f f)) [(Rec [rec35643] [rec35643 :-> (IFn)]) :-> (IFn)])
(ann
(fn [f] (ann (fn [g] (f g)) (IFn)))
(Rec [rec35653] [rec35653 :-> (IFn)])))
; pprinted
(let [f (ann
(fn [f]
(ann (fn [g] (f g)) (IFn)))
(Rec [rec35653] [rec35653 :-> (IFn)]))]
(ann (f f)) (IFn))
(let [f (fn :ann (Rec [rec35653] [rec35653 :-> (IFn)])
[f]
(fn :ann (IFn)
[g]
(f g)))]
(f f))
;((fn [b] body) v)
;=>
;(let [b v] body)
n = 2
(let [f (fn [f]
(fn [g]
(f g)))]
((f f) f))
;((ann
; (fn [f] ((f f) f))
; [(Rec [rec35719] [rec35719 :-> (U (IFn) [rec35719 :-> (IFn)])])
; :->
; (IFn)])
; (ann
; (fn
; [f]
; (ann
; (fn [g] (f g))
; (EnclosingFnCase
; 0
; [(Rec [rec35727] [rec35727 :-> (U (IFn) [rec35727 :-> (IFn)])])
; :->
; Any]
; (Rec
; [rec35734]
; [(Rec [rec35735] [rec35735 :-> (U (IFn) rec35734)]) :-> (IFn)])
; [(Rec [rec35742] [rec35742 :-> (U (IFn) [rec35742 :-> (IFn)])])
; :->
; Any]
; (IFn))))
; (Rec [rec35750] [rec35750 :-> (U (IFn) [rec35750 :-> (IFn)])])))
(let [f (ann
(fn
[f]
(ann
(fn [g] (f g))
(EnclosingFnCase
0
[(Rec [rec35727] [rec35727 :-> (U (IFn) [rec35727 :-> (IFn)])])
:->
Any]
(Rec
[rec35734]
[(Rec [rec35735] [rec35735 :-> (U (IFn) rec35734)]) :-> (IFn)])
[(Rec [rec35742] [rec35742 :-> (U (IFn) [rec35742 :-> (IFn)])])
:->
Any]
(IFn))))]
(Rec [rec35750] [rec35750 :-> (U (IFn) [rec35750 :-> (IFn)])]))
((f f) f))
[(Rec [rec35719] [rec35719 :-> (U (IFn) [rec35719 :-> (IFn)])])
:->
(IFn)])
)