-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.tests
202 lines (155 loc) · 4.96 KB
/
examples.tests
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
Polymorphic Instantiation (A1)
fun(x)(y) { y }
stdout : fun : (a) -b-> (c::Any) -d-> c::Any
Polymorphic Instantiation (A1•)
$(fun(x)(y) { y })
stdout : fun : forall a,b::Row,c::(Any,Any),d::Row.(a) -b-> (c::Any) -d-> c::Any
Polymorphic Instantiation (A2)
choose(id)
stdout : fun : ((a) -b-> a) -c-> (a) -b-> a
Polymorphic Instantiation (A2•)
choose(~id)
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> forall a,b::Row.(a) -b-> a
Polymorphic Instantiation (A3)
choose([])(ids)
stdout : [] : [forall a,b::Row.(a) -b-> a]
Polymorphic Instantiation (A4)
fun(x : (forall a,b::Row. (a) -b-> a)) { x(x) }
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> (d) -e-> d
Polymorphic Instantiation (A4•)
fun(x : (forall a,b::Row. (a) -b-> a)) { x(~x) }
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> forall a,b::Row.(a) -b-> a
Polymorphic Instantiation (A5)
id(auto)
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> forall d,e::Row.(d) -e-> d
Polymorphic Instantiation (A6)
id(auto')
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> (d) -e-> d
Polymorphic Instantiation (A6•)
id(~auto')
stdout : fun : forall a,b::Row,c::Row.(forall d,e::Row.(d) -e-> d) -b-> (a) -c-> a
Polymorphic Instantiation (A7)
choose(id)(auto)
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> forall a,b::Row.(a) -b-> a
Polymorphic Instantiation (A8), type-checking supposed to fail
choose(id)(auto')
exit : 1
stderr : @.*Type error:.*
Polymorphic Instantiation (A9*) (see file ~/freezeml/a9.links)
a9.links
filemode : true
stdout : fun : forall a,b::Row.(a) -b-> a
Polymorphic Instantiation (A10*)
poly(~id)
stdout : (0, true) : (Int, Bool)
Polymorphic Instantiation (A11*)
poly($(fun(x:_::(Unl,Any)) { x }))
stdout : (0, true) : (Int, Bool)
Polymorphic Instantiation (A12*)
id(poly)($(fun(x:_::(Unl,Any)) { x }))
stdout : (0, true) : (Int, Bool)
Inference of Polymorphic Arguments (B1*)
fun(f : (forall a,b::Row. (a) -b-> a)) { (f(1), f(true)) }
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> (Int, Bool)
Inference of Polymorphic Arguments (B2*)
fun(xs : [forall a,b::Row. (a) -b-> a]) { poly(head(xs)) }
stdout : fun : ([forall a,b::Row.(a) -b-> a]) -c-> (Int, Bool)
Functions on Polymorphic Lists (C1)
length(ids)
stdout : 1 : Int
Functions on Polymorphic Lists (C2)
tail(ids)
stdout : [] : [forall a,b::Row.(a) -b-> a]
Functions on Polymorphic Lists (C3)
head(ids)
stdout : fun : forall a,b::Row.(a) -b-> a
Functions on Polymorphic Lists (C4)
single(id)
stdout : [fun] : [(a) -b-> a]
Functions on Polymorphic Lists (C4•)
single(~id)
stdout : [fun] : [forall a,b::Row.(a) -b-> a]
Functions on Polymorphic Lists (C5*)
~id :: ids
stdout : [fun, fun] : [forall a,b::Row.(a) -b-> a]
Functions on Polymorphic Lists (C6*)
$(fun(x:_::(Unl,Any)) { x }) :: ids
stdout : [fun, fun] : [forall a,b::Row.(a) -b-> a]
Functions on Polymorphic Lists (C7)
single(inc) ++ single(id)
stdout : [fun, fun] : [(Int) -a-> Int]
Functions on Polymorphic Lists (C8*)
c8.links
filemode : true
stdout : fun : forall a,b::Row.(a) -b-> a
Functions on Polymorphic Lists (C9*)
map(poly)(single(~id))
stdout : [(0, true)] : [(Int, Bool)]
Functions on Polymorphic Lists (C10)
map(head)(single(ids))
stdout : [fun] : [forall a,b::Row.(a) -b-> a]
Application functions (D1*)
app(poly)(~id)
stdout : (0, true) : (Int, Bool)
Application functions (D2*)
revapp(~id)(poly)
stdout : (0, true) : (Int, Bool)
Application functions (D3*)
runST(~argST)
stdout : 0 : Int
Application functions (D4*)
app(runST)(~argST)
stdout : 0 : Int
Application functions (D5*)
revapp(~argST)(runST)
stdout : 0 : Int
eta-expansion (E1) (see file ~/freezeml/e1.links), type-checking supposed to fail
e1.links
filemode : true
exit : 1
stderr : @.*Type error:.*
eta-expansion (E2*) (see file ~/freezeml/e2.links)
e2.links
filemode : true
stdout : fun : forall a::Row,b,c::Row.(Int) -a-> (b) -c-> b
eta-expansion (E3) (see file ~/freezeml/e3.links), type-checking supposed to fail
e3.links
filemode : true
exit : 1
stderr : @.*Type error:.*
eta-expansion (E3•) (see file ~/freezeml/e3dot.links)
e3dot.links
filemode : true
stdout : 0 : Int
FreezeML programs (F1)
fun id(x) { x } ~id
stdout : fun : forall a::(Any,Any),b::Row.(a::Any) -b-> a::Any
FreezeML programs (F2)
var ids = [~id]; ~ids
stdout : [fun] : [forall a,b::Row.(a) -b-> a]
FreezeML programs (F3)
f3.links
filemode : true
stdout : fun : forall a::Row.(forall b,c::Row.(b) -c-> b) -a-> forall b,c::Row.(b) -c-> b
FreezeML programs (F4)
f4.links
filemode : true
stdout : fun : forall a::Row,b,c::Row.(forall d,e::Row.(d) -e-> d) -a-> (b) -c-> b
FreezeML programs (F5*)
auto(~id)
stdout : fun : forall a,b::Row.(a) -b-> a
FreezeML programs (F6)
head(ids) :: ids
stdout : [fun, fun] : [forall a,b::Row.(a) -b-> a]
FreezeML programs (F7*)
head(ids)@(3)
stdout : 3 : Int
FreezeML programs (F8)
choose (head(ids))
stdout : fun : (forall a,b::Row.(a) -b-> a) -c-> forall a,b::Row.(a) -b-> a
FreezeML programs (F8•)
choose (head(ids)@)
stdout : fun : ((a) -b-> a) -c-> (a) -b-> a
FreezeML programs (F9)
var f = revapp(~id); f(poly)
stdout : (0, true) : (Int, Bool)