summaryrefslogtreecommitdiff
path: root/testdata/primes.out
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-05-11 20:57:07 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-05-12 00:50:34 +0200
commite4725c07ee3e7e3fc010df418d16f37c39b0af0f (patch)
treecb10e1d1203eed875955097311ccbe0943564226 /testdata/primes.out
parent95e006bf5afa8d3473e3fe4401f4c9316186a428 (diff)
mutual function definitions
Diffstat (limited to 'testdata/primes.out')
-rw-r--r--testdata/primes.out553
1 files changed, 552 insertions, 1 deletions
diff --git a/testdata/primes.out b/testdata/primes.out
index b74e882a..b741b012 100644
--- a/testdata/primes.out
+++ b/testdata/primes.out
@@ -1 +1,552 @@
131 \ No newline at end of file 1main :: Int
2main = 31
3------------ desugared source code
4infixr 0 $
5
6($) = _lhs ($) \(a :: _) (b :: _) -> _rhs (a b)
7
8id = _lhs id \(a :: _) -> _rhs a
9
10foldr
11 = primFix
12 \(a :: _) -> _lhs
13 foldr
14 \(b :: _) (c :: _) (d :: _) -> case'List
15 (\(_ :: _) -> _)
16 (_rhs c)
17 (\(e :: _) (f :: _) -> _rhs (b e $ a b c f))
18 d
19
20filter
21 = _lhs
22 filter
23 \(a :: _) -> _rhs
24 (foldr (\(b :: _) (c :: _) -> primIfThenElse (a b) (b : c) c) [])
25
26(&&)
27 = _lhs
28 (&&)
29 \(a :: _) (b :: _) -> case'Bool (\(_ :: _) -> _) (_rhs False) (_rhs b) a
30
31and = _lhs and (_rhs (foldr (&&) True))
32
33map = _lhs map \(a :: _) -> _rhs (foldr (\(b :: _) (c :: _) -> a b : c) [])
34
35mod = _lhs mod (_rhs primModInt)
36
37iSqrt
38 = _lhs iSqrt \(a :: _) -> _rhs (primRound (primSqrtFloat (primIntToFloat a)))
39
40(+) = _lhs (+) (_rhs primAddInt)
41
42(-) = _lhs (-) (_rhs primSubInt)
43
44(<=)
45 = _lhs
46 (<=)
47 \(a :: _) (b :: _) -> _rhs
48 ((\(c :: _) -> case'Ordering (\(_ :: _) -> _) True True False c)
49 (primCompareInt a b))
50
51not
52 = _lhs not \(a :: _) -> case'Bool (\(_ :: _) -> _) (_rhs True) (_rhs False) a
53
54(/=) = _lhs (/=) \(a :: _) (b :: _) -> _rhs (not $ a == b)
55
56takeWhile
57 = primFix
58 \(a :: _) -> _lhs
59 takeWhile
60 \(b :: _) (c :: _) -> case'List
61 (\(_ :: _) -> _)
62 (_rhs [])
63 (\(d :: _) (e :: _) -> case'Bool
64 (\(_ :: _) -> _)
65 (_rhs [])
66 (_rhs (d : a b e))
67 (b d))
68 c
69
70from = primFix \(a :: _) -> _lhs from \(b :: _) -> _rhs (b : a (b + fromInt 1))
71
72primes :: [Int]
73primes
74 = primFix
75 \(a :: [Int]) -> _lhs
76 primes
77 (_rhs
78 (fromInt 2
79 : fromInt 3
80 : filter
81 (\(b :: _) -> and
82 $ map
83 (\(c :: _) -> b `mod` c /= fromInt 0)
84 (takeWhile (\(d :: _) -> d <= iSqrt b) a))
85 (from (fromInt 5))))
86
87(!!)
88 = primFix
89 \(a :: _) -> _lhs
90 (!!)
91 \(b :: _) (c :: _) -> case'List
92 (\(_ :: _) -> _)
93 (_rhs undefined)
94 (\(d :: _) (e :: _) -> case'Bool
95 (\(_ :: _) -> _)
96 (_rhs (a e (c - fromInt 1)))
97 (_rhs d)
98 (fromInt 0 == c))
99 b
100
101main = _lhs main (_rhs (primes !! fromInt 10))
102------------ core code
103!! :: forall a . [a] -> Int -> a
104!!
105 = \a -> primFix
106 _
107 \b c d -> case'List
108 (\_ -> a)
109 (_rhs (undefined a))
110 (\e f -> case'Bool
111 (\_ -> a)
112 (_rhs (b f (primSubInt d 1)))
113 (_rhs e)
114 (isEQ (primCompareInt 0 d)))
115 c
116
117$ :: forall a b . (a -> b) -> a -> b
118$ = \a b c d -> _rhs (c d)
119
120&& :: Bool -> Bool -> Bool
121&& = \a b -> case'Bool (\_ -> 'Bool) (_rhs False) (_rhs b) a
122
123+ :: Int -> Int -> Int
124+ = _rhs \a b -> primAddInt a b
125
126- :: Int -> Int -> Int
127- = _rhs \a b -> primSubInt a b
128
129/= :: forall a . Eq a => a -> a -> Bool
130/= = \a b c d -> _rhs (not ((a == b) c d))
131
132<= :: Int -> Int -> Bool
133<=
134 = \a b -> _rhs
135 (case'Ordering (\_ -> 'Bool) True True False (primCompareInt a b))
136
137and :: [Bool] -> Bool
138and = _rhs (foldr (&&) True)
139
140filter :: forall a . (a -> Bool) -> [a] -> [a]
141filter = \a b -> _rhs (foldr (\c d -> primIfThenElse [a] (b c) (c : d) d) [])
142
143foldr :: forall a b . (b -> a -> a) -> a -> [b] -> a
144foldr
145 = \a b -> primFix
146 _
147 \c d e f -> case'List (\_ -> a) (_rhs e) (\g h -> _rhs (d g (c d e h))) f
148
149from :: Int -> [Int]
150from = primFix _ \a b -> _rhs (b : a (primAddInt b 1))
151
152iSqrt :: Int -> Int
153iSqrt = \a -> _rhs (primRound (primSqrtFloat (primIntToFloat a)))
154
155id :: forall a . a -> a
156id = \a b -> _rhs b
157
158main :: Int
159main = _rhs 31
160
161map :: forall a b . (a -> b) -> [a] -> [b]
162map = \a b c -> _rhs (foldr (\d e -> c d : e) [])
163
164mod :: Int -> Int -> Int
165mod = _rhs \a b -> primModInt a b
166
167not :: Bool -> Bool
168not = \a -> case'Bool (\_ -> 'Bool) (_rhs True) (_rhs False) a
169
170primes :: [Int]
171primes
172 = primFix
173 _
174 \a -> _rhs
175 (2
176 : 3
177 : foldr
178 (\b c -> primIfThenElse
179 ['Int]
180 (and
181 $ foldr (\d e -> primModInt b d /= 0 : e) [] (takeWhile (\f -> f <= iSqrt b) a))
182 (b : c)
183 c)
184 []
185 (from 5))
186
187takeWhile :: forall a . (a -> Bool) -> [a] -> [a]
188takeWhile
189 = \a -> primFix
190 _
191 \b c d -> case'List
192 (\_ -> [a])
193 (_rhs [])
194 (\e f -> case'Bool (\_ -> [a]) (_rhs []) (_rhs (e : b c f)) (c e))
195 d
196------------ tooltips
197testdata/primes.lc 7:3-7:4
198 forall a b . (a -> b) -> a -> b
199testdata/primes.lc 7:9-7:10
200 _d
201testdata/primes.lc 7:11-7:12
202 _e
203testdata/primes.lc 9:1-9:3
204 forall a . a -> a
205testdata/primes.lc 9:8-9:9
206 _b
207testdata/primes.lc 11:1-11:6
208 forall a b . (b -> a -> a) -> a -> [b] -> a
209testdata/primes.lc 11:16-11:17
210 _f
211testdata/primes.lc 11:16-12:39
212 [_b] -> _f
213testdata/primes.lc 12:21-12:22
214 _k
215testdata/primes.lc 12:21-12:26
216 _b -> _a
217testdata/primes.lc 12:21-12:39
218 _h
219testdata/primes.lc 12:23-12:24
220 _h
221testdata/primes.lc 12:25-12:26
222 forall a b . (a -> b) -> a -> b
223testdata/primes.lc 12:27-12:32
224 _k
225testdata/primes.lc 12:33-12:34
226 _g -> _d -> _k
227testdata/primes.lc 12:35-12:36
228 _l
229testdata/primes.lc 12:37-12:39
230 [_h]
231testdata/primes.lc 19:1-19:7
232 forall a . (a -> Bool) -> [a] -> [a]
233testdata/primes.lc 19:12-19:17
234 forall a b . (b -> a -> a) -> a -> [b] -> a
235testdata/primes.lc 19:12-19:54
236 [_a] -> [_a] -> [_a]
237testdata/primes.lc 19:12-19:57
238 [_a] -> [_a]
239testdata/primes.lc 19:28-19:53
240 [_c]
241testdata/primes.lc 19:31-19:32
242 _g
243testdata/primes.lc 19:31-19:45
244 [_c] -> [_c]
245testdata/primes.lc 19:33-19:34
246 _g
247testdata/primes.lc 19:40-19:41
248 _e
249testdata/primes.lc 19:40-19:42
250 [_d] -> [_d]
251testdata/primes.lc 19:40-19:45
252 [_c]
253testdata/primes.lc 19:41-19:42
254 forall a . a -> [a] -> [a]
255testdata/primes.lc 19:43-19:45
256 _d
257testdata/primes.lc 19:51-19:53
258 [_c]
259testdata/primes.lc 19:55-19:57
260 forall a . [a]
261testdata/primes.lc 21:6-21:8
262 Bool -> Bool -> Bool
263testdata/primes.lc 21:13-21:14
264 _b
265testdata/primes.lc 21:13-22:19
266 Bool -> Bool
267testdata/primes.lc 22:14-22:19
268 Bool
269testdata/primes.lc 24:1-24:4
270 [Bool] -> Bool
271testdata/primes.lc 24:7-24:12
272 forall a b . (b -> a -> a) -> a -> [b] -> a
273testdata/primes.lc 24:7-24:17
274 Bool -> [Bool] -> Bool
275testdata/primes.lc 24:7-24:22
276 [Bool] -> Bool
277testdata/primes.lc 24:13-24:17
278 Bool -> Bool -> Bool
279testdata/primes.lc 24:18-24:22
280 Bool
281testdata/primes.lc 26:1-26:4
282 forall a b . (a -> b) -> [a] -> [b]
283testdata/primes.lc 26:9-26:14
284 forall a b . (b -> a -> a) -> a -> [b] -> a
285testdata/primes.lc 26:9-26:33
286 [_a] -> [_b] -> [_a]
287testdata/primes.lc 26:9-26:36
288 [_b] -> [_a]
289testdata/primes.lc 26:25-26:26
290 _g
291testdata/primes.lc 26:25-26:29
292 [_a] -> [_a]
293testdata/primes.lc 26:25-26:32
294 [_a]
295testdata/primes.lc 26:27-26:28
296 _g
297testdata/primes.lc 26:28-26:29
298 forall a . a -> [a] -> [a]
299testdata/primes.lc 26:30-26:32
300 [_a]
301testdata/primes.lc 26:34-26:36
302 forall a . [a]
303testdata/primes.lc 28:1-28:4
304 Int -> Int -> Int
305testdata/primes.lc 28:7-28:17
306 Int -> Int -> Int
307testdata/primes.lc 29:1-29:6
308 Int -> Int
309testdata/primes.lc 29:11-29:20
310 Float -> Int
311testdata/primes.lc 29:11-29:55
312 Int
313testdata/primes.lc 29:22-29:35
314 Float -> Float
315testdata/primes.lc 29:22-29:54
316 Float
317testdata/primes.lc 29:37-29:51
318 Int -> Float
319testdata/primes.lc 29:37-29:53
320 Float
321testdata/primes.lc 29:52-29:53
322 _b
323testdata/primes.lc 30:2-30:3
324 Int -> Int -> Int
325testdata/primes.lc 30:7-30:17
326 Int -> Int -> Int
327testdata/primes.lc 31:2-31:3
328 Int -> Int -> Int
329testdata/primes.lc 31:7-31:17
330 Int -> Int -> Int
331testdata/primes.lc 33:3-33:5
332 Int -> Int -> Bool
333testdata/primes.lc 33:10-35:14
334 Bool
335testdata/primes.lc 33:15-33:29
336 Int -> Int -> Ordering
337testdata/primes.lc 33:15-33:31
338 Int -> Ordering
339testdata/primes.lc 33:15-33:33
340 Ordering
341testdata/primes.lc 33:30-33:31
342 _d
343testdata/primes.lc 33:32-33:33
344 _b
345testdata/primes.lc 34:11-34:16
346 Bool
347testdata/primes.lc 34:11-35:14
348 Ordering -> Bool
349testdata/primes.lc 35:10-35:14
350 Bool | Bool
351testdata/primes.lc 37:1-37:4
352 Bool -> Bool
353testdata/primes.lc 37:13-37:17
354 Bool
355testdata/primes.lc 37:13-38:17
356 Bool -> Bool
357testdata/primes.lc 38:12-38:17
358 Bool
359testdata/primes.lc 40:3-40:5
360 forall a . Eq a => a -> a -> Bool
361testdata/primes.lc 40:10-40:13
362 Bool -> Bool
363testdata/primes.lc 40:10-40:15
364 Bool -> Bool
365testdata/primes.lc 40:10-40:22
366 Bool
367testdata/primes.lc 40:14-40:15
368 forall a b . (a -> b) -> a -> b
369testdata/primes.lc 40:16-40:17
370 _f
371testdata/primes.lc 40:16-40:20
372 _e -> Bool
373testdata/primes.lc 40:16-40:22
374 Bool
375testdata/primes.lc 40:18-40:20
376 forall a . Eq a => a -> a -> Bool
377testdata/primes.lc 40:21-40:22
378 _c
379testdata/primes.lc 42:1-42:10
380 forall a . (a -> Bool) -> [a] -> [a]
381testdata/primes.lc 42:23-42:24
382 _g
383testdata/primes.lc 42:23-43:19
384 [_c]
385testdata/primes.lc 42:25-42:26
386 _f
387testdata/primes.lc 42:29-42:30
388 _f
389testdata/primes.lc 42:29-42:31
390 [_e] -> [_e]
391testdata/primes.lc 42:29-42:46
392 [_d]
393testdata/primes.lc 42:29-43:19
394 Bool -> [_d]
395testdata/primes.lc 42:30-42:31
396 forall a . a -> [a] -> [a]
397testdata/primes.lc 42:32-42:41
398 _j
399testdata/primes.lc 42:42-42:43
400 _k
401testdata/primes.lc 42:44-42:46
402 [_h]
403testdata/primes.lc 43:17-43:19
404 forall a . [a] | forall a . [a]
405testdata/primes.lc 45:1-45:5
406 Int -> [Int]
407testdata/primes.lc 45:10-45:11
408 _c
409testdata/primes.lc 45:10-45:12
410 [_b] -> [_b]
411testdata/primes.lc 45:10-45:25
412 [Int]
413testdata/primes.lc 45:11-45:12
414 forall a . a -> [a] -> [a]
415testdata/primes.lc 45:13-45:17
416 _d
417testdata/primes.lc 45:19-45:20
418 _e
419testdata/primes.lc 45:19-45:22
420 Int -> Int
421testdata/primes.lc 45:19-45:24
422 Int
423testdata/primes.lc 45:21-45:22
424 Int -> Int -> Int
425testdata/primes.lc 45:23-45:24
426 _b
427testdata/primes.lc 47:11-47:16
428 Type
429testdata/primes.lc 47:12-47:15
430 Type
431testdata/primes.lc 48:1-48:7
432 [Int]
433testdata/primes.lc 48:10-48:11
434 _b
435testdata/primes.lc 48:10-48:12
436 [_b] -> [_b]
437testdata/primes.lc 48:10-48:111
438 [Int]
439testdata/primes.lc 48:11-48:12
440 forall a . a -> [a] -> [a]
441testdata/primes.lc 48:12-48:13
442 _b
443testdata/primes.lc 48:12-48:14
444 [_b] -> [_b]
445testdata/primes.lc 48:12-48:111
446 [Int]
447testdata/primes.lc 48:13-48:14
448 forall a . a -> [a] -> [a]
449testdata/primes.lc 48:15-48:21
450 forall a . (a -> Bool) -> [a] -> [a]
451testdata/primes.lc 48:15-48:102
452 [Int] -> [Int]
453testdata/primes.lc 48:15-48:111
454 [Int]
455testdata/primes.lc 48:29-48:32
456 [Bool] -> Bool
457testdata/primes.lc 48:29-48:34
458 [Bool] -> Bool
459testdata/primes.lc 48:29-48:101
460 Bool
461testdata/primes.lc 48:33-48:34
462 forall a b . (a -> b) -> a -> b
463testdata/primes.lc 48:35-48:38
464 forall a b . (a -> b) -> [a] -> [b]
465testdata/primes.lc 48:35-48:61
466 [Int] -> [Bool]
467testdata/primes.lc 48:35-48:101
468 [Bool]
469testdata/primes.lc 48:46-48:47
470 _g
471testdata/primes.lc 48:46-48:53
472 Int -> Int
473testdata/primes.lc 48:46-48:55
474 Int
475testdata/primes.lc 48:46-48:58
476 Int -> Bool
477testdata/primes.lc 48:46-48:60
478 Bool
479testdata/primes.lc 48:48-48:53
480 Int -> Int -> Int
481testdata/primes.lc 48:54-48:55
482 _d
483testdata/primes.lc 48:56-48:58
484 forall a . Eq a => a -> a -> Bool
485testdata/primes.lc 48:59-48:60
486 _b
487testdata/primes.lc 48:63-48:72
488 forall a . (a -> Bool) -> [a] -> [a]
489testdata/primes.lc 48:63-48:93
490 [Int] -> [Int]
491testdata/primes.lc 48:63-48:100
492 [Int]
493testdata/primes.lc 48:80-48:81
494 _b
495testdata/primes.lc 48:80-48:84
496 Int -> Bool
497testdata/primes.lc 48:80-48:92
498 Bool
499testdata/primes.lc 48:82-48:84
500 Int -> Int -> Bool
501testdata/primes.lc 48:85-48:90
502 Int -> Int
503testdata/primes.lc 48:85-48:92
504 Int
505testdata/primes.lc 48:91-48:92
506 Int
507testdata/primes.lc 48:94-48:100
508 [Int]
509testdata/primes.lc 48:104-48:108
510 Int -> [Int]
511testdata/primes.lc 48:104-48:110
512 [Int]
513testdata/primes.lc 48:109-48:110
514 _b
515testdata/primes.lc 50:8-50:10
516 forall a . [a] -> Int -> a
517testdata/primes.lc 50:15-50:16
518 _e
519testdata/primes.lc 50:15-51:28
520 Bool -> _d | _c
521testdata/primes.lc 51:17-51:19
522 [_h]
523testdata/primes.lc 51:20-51:22
524 _k
525testdata/primes.lc 51:24-51:25
526 _k
527testdata/primes.lc 51:24-51:26
528 Int -> Int
529testdata/primes.lc 51:24-51:27
530 Int
531testdata/primes.lc 51:25-51:26
532 Int -> Int -> Int
533testdata/primes.lc 51:26-51:27
534 _b
535testdata/primes.lc 53:1-53:5
536 Int
537testdata/primes.lc 53:8-53:14
538 [Int]
539testdata/primes.lc 53:8-53:17
540 Int -> Int
541testdata/primes.lc 53:8-53:20
542 Int
543testdata/primes.lc 53:15-53:17
544 forall a . [a] -> Int -> a
545testdata/primes.lc 53:18-53:20
546 _b
547------------ warnings
548Uncovered pattern(s) at testdata/primes.lc:50:8:
549(x: _) !! 0 = x
550(_ : xs) !! n = xs !! (n-1)
551Missing case(s):
552 [] !! _ \ No newline at end of file