@@ -60,177 +60,12 @@ n4: PerfectTree[int]
60
60
//│ = Node1 { subTree: Node1 { subTree: Leaf { value: [Array] } } }
61
61
62
62
63
- :e // * Needs precise-rec-typing (see below)
64
- rec def map f tree = case tree of {
65
- | Leaf -> Leaf { value = f tree.value }
66
- | Node -> Node { subTree = map (mapTwo f) tree.subTree }
67
- }
68
- //│ ╔══[ERROR] Inferred recursive type: 'a
69
- //│ where
70
- //│ 'a <: {subTree: Leaf[?] & {value: ((?, (?, ?,),), ((?, ?,), ?,),)} | Node[?] & 'a}
71
- //│ ║ l.64: rec def map f tree = case tree of {
72
- //│ ╙── ^^^^
73
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
74
- //│ ║ l.64: rec def map f tree = case tree of {
75
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
76
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
77
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
79
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
80
- //│ ║ l.67: }
81
- //│ ║ ^^^
82
- //│ ╙── Note: use flag `:ex` to see internal error info.
83
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
84
- //│ ║ l.64: rec def map f tree = case tree of {
85
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
86
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
87
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
89
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90
- //│ ║ l.67: }
91
- //│ ║ ^^^
92
- //│ ╙── Note: use flag `:ex` to see internal error info.
93
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
94
- //│ ║ l.64: rec def map f tree = case tree of {
95
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
96
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
97
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
99
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100
- //│ ║ l.67: }
101
- //│ ║ ^^^
102
- //│ ╙── Note: use flag `:ex` to see internal error info.
103
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
104
- //│ ║ l.64: rec def map f tree = case tree of {
105
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
106
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
107
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
109
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110
- //│ ║ l.67: }
111
- //│ ║ ^^^
112
- //│ ╙── Note: use flag `:ex` to see internal error info.
113
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
114
- //│ ║ l.64: rec def map f tree = case tree of {
115
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
116
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
117
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
118
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
119
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
120
- //│ ║ l.67: }
121
- //│ ║ ^^^
122
- //│ ╙── Note: use flag `:ex` to see internal error info.
123
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
124
- //│ ║ l.64: rec def map f tree = case tree of {
125
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
126
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
127
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
128
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
129
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
130
- //│ ║ l.67: }
131
- //│ ║ ^^^
132
- //│ ╙── Note: use flag `:ex` to see internal error info.
133
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
134
- //│ ║ l.64: rec def map f tree = case tree of {
135
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
136
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
137
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
138
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
139
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
- //│ ║ l.67: }
141
- //│ ║ ^^^
142
- //│ ╙── Note: use flag `:ex` to see internal error info.
143
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
144
- //│ ║ l.64: rec def map f tree = case tree of {
145
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
146
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
147
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
149
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
150
- //│ ║ l.67: }
151
- //│ ║ ^^^
152
- //│ ╙── Note: use flag `:ex` to see internal error info.
153
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
154
- //│ ║ l.64: rec def map f tree = case tree of {
155
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
156
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
157
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
159
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
160
- //│ ║ l.67: }
161
- //│ ║ ^^^
162
- //│ ╙── Note: use flag `:ex` to see internal error info.
163
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
164
- //│ ║ l.64: rec def map f tree = case tree of {
165
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
166
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
167
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
168
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
169
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
170
- //│ ║ l.67: }
171
- //│ ║ ^^^
172
- //│ ╙── Note: use flag `:ex` to see internal error info.
173
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
174
- //│ ║ l.64: rec def map f tree = case tree of {
175
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
176
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
177
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
178
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
179
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180
- //│ ║ l.67: }
181
- //│ ║ ^^^
182
- //│ ╙── Note: use flag `:ex` to see internal error info.
183
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
184
- //│ ║ l.64: rec def map f tree = case tree of {
185
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
186
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
187
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
188
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
189
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
190
- //│ ║ l.67: }
191
- //│ ║ ^^^
192
- //│ ╙── Note: use flag `:ex` to see internal error info.
193
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
194
- //│ ║ l.64: rec def map f tree = case tree of {
195
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
196
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
197
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
199
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
200
- //│ ║ l.67: }
201
- //│ ║ ^^^
202
- //│ ╙── Note: use flag `:ex` to see internal error info.
203
- //│ ╔══[ERROR] Cyclic-looking constraint while typing binding of lambda expression; a type annotation may be required
204
- //│ ║ l.64: rec def map f tree = case tree of {
205
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
206
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
207
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
208
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
209
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
- //│ ║ l.67: }
211
- //│ ║ ^^^
212
- //│ ╙── Note: use flag `:ex` to see internal error info.
213
- //│ ╔══[ERROR] Subtyping constraint of the form `?a -> ?b -> (?c | ?d) <: ?map` exceeded recursion depth limit (250)
214
- //│ ║ l.64: rec def map f tree = case tree of {
215
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^
216
- //│ ║ l.65: | Leaf -> Leaf { value = f tree.value }
217
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
218
- //│ ║ l.66: | Node -> Node { subTree = map (mapTwo f) tree.subTree }
219
- //│ ║ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
220
- //│ ║ l.67: }
221
- //│ ║ ^^^
222
- //│ ╙── Note: use flag `:ex` to see internal error info.
223
- //│ map: ('value -> (Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'value0) & 'a -> (Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'b & 'A) & 'c -> (Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'd & 'A) & 'e -> (Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'f & 'A) & 'g -> (Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'h & 'A)) -> 'i -> (Leaf[((nothing, (nothing, nothing,) | 'd,) | 'b, ((nothing, nothing,) | 'h, nothing,) | 'f,) | 'value0] | 'j)
224
- //│ where
225
- //│ 'j :> Node['A] with {
226
- //│ subTree: Leaf[((nothing, (nothing, nothing,) | 'd,) | 'b, ((nothing, nothing,) | 'h, nothing,) | 'f,) | 'value0] | 'j
227
- //│ }
228
- //│ 'i <: Leaf[?] & {
229
- //│ value: ((anything, (anything, anything,) & 'c,) & 'a, ((anything, anything,) & 'g, anything,) & 'e,) & 'value
230
- //│ } | (Node[?] with {subTree: 'i})
231
- //│ 'A :> ((nothing, nothing,) | 'h, (nothing, nothing,) | 'd,)
232
- //│ <: Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two[Two['A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A] & 'A]
233
- //│ = [Function: map]
63
+ // * On some systems, the default -Xss4M is not enough for this case
64
+ // :e // * Needs precise-rec-typing (see below)
65
+ // rec def map f tree = case tree of {
66
+ // | Leaf -> Leaf { value = f tree.value }
67
+ // | Node -> Node { subTree = map (mapTwo f) tree.subTree }
68
+ // }
234
69
235
70
:e // occurs-check
236
71
:precise-rec-typing
@@ -255,7 +90,7 @@ rec def map f tree = case tree of {
255
90
//│ where
256
91
//│ 'a <: 'b -> 'c & 'd -> 'e) -> 'subTree -> (PerfectTree[Two['A]] & 'subTree0)
257
92
//│ 'a <: 'value -> 'value0)
258
- //│ = [Function: map1 ]
93
+ //│ = [Function: map ]
259
94
260
95
:e
261
96
map succ n4
@@ -269,8 +104,8 @@ map succ n4
269
104
//│ 'a <: 'value -> 'value0)
270
105
//│ ╙──
271
106
//│ ╔══[ERROR] Cyclic-looking constraint while typing application; a type annotation may be required
272
- //│ ║ l.261 : map succ n4
273
- //│ ║ ^^^^^^^^^^^
107
+ //│ ║ l.96 : map succ n4
108
+ //│ ║ ^^^^^^^^^^^
274
109
//│ ╙── Note: use flag `:ex` to see internal error info.
275
110
//│ res: error
276
111
//│ = Node1 { subTree: Node1 { subTree: Leaf { value: [Array] } } }
0 commit comments