diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-05-12 03:02:50 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-05-12 03:02:50 +0200 |
commit | 3b66a4fdfbd74e9dc77b05536062129018fb0ade (patch) | |
tree | 7c420b856a3e9c1b3c47cfd8b78f3c4dd773f3d2 | |
parent | 7acd3bbffbf87f88d0b3510f44ff1c5b35cfd9d6 (diff) |
update primes example
-rw-r--r-- | testdata/primes.lc | 2 | ||||
-rw-r--r-- | testdata/primes.out | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/testdata/primes.lc b/testdata/primes.lc index baf067d2..612941e1 100644 --- a/testdata/primes.lc +++ b/testdata/primes.lc | |||
@@ -50,5 +50,5 @@ primes = 2:3: filter (\n -> and $ map (\p -> n `mod` p /= 0) (takeWhile (\x -> x | |||
50 | (x: _) !! 0 = x | 50 | (x: _) !! 0 = x |
51 | (_ : xs) !! n = xs !! (n-1) | 51 | (_ : xs) !! n = xs !! (n-1) |
52 | 52 | ||
53 | main = primes !! 10 -- TODO: 100 | 53 | main = primes !! 130 |
54 | 54 | ||
diff --git a/testdata/primes.out b/testdata/primes.out index b741b012..176f48ab 100644 --- a/testdata/primes.out +++ b/testdata/primes.out | |||
@@ -1,5 +1,5 @@ | |||
1 | main :: Int | 1 | main :: Int |
2 | main = 31 | 2 | main = 739 |
3 | ------------ desugared source code | 3 | ------------ desugared source code |
4 | infixr 0 $ | 4 | infixr 0 $ |
5 | 5 | ||
@@ -98,7 +98,7 @@ primes | |||
98 | (fromInt 0 == c)) | 98 | (fromInt 0 == c)) |
99 | b | 99 | b |
100 | 100 | ||
101 | main = _lhs main (_rhs (primes !! fromInt 10)) | 101 | main = _lhs main (_rhs (primes !! fromInt 130)) |
102 | ------------ core code | 102 | ------------ core code |
103 | !! :: forall a . [a] -> Int -> a | 103 | !! :: forall a . [a] -> Int -> a |
104 | !! | 104 | !! |
@@ -156,7 +156,7 @@ id :: forall a . a -> a | |||
156 | id = \a b -> _rhs b | 156 | id = \a b -> _rhs b |
157 | 157 | ||
158 | main :: Int | 158 | main :: Int |
159 | main = _rhs 31 | 159 | main = _rhs 739 |
160 | 160 | ||
161 | map :: forall a b . (a -> b) -> [a] -> [b] | 161 | map :: forall a b . (a -> b) -> [a] -> [b] |
162 | map = \a b c -> _rhs (foldr (\d e -> c d : e) []) | 162 | map = \a b c -> _rhs (foldr (\d e -> c d : e) []) |
@@ -538,11 +538,11 @@ testdata/primes.lc 53:8-53:14 | |||
538 | [Int] | 538 | [Int] |
539 | testdata/primes.lc 53:8-53:17 | 539 | testdata/primes.lc 53:8-53:17 |
540 | Int -> Int | 540 | Int -> Int |
541 | testdata/primes.lc 53:8-53:20 | 541 | testdata/primes.lc 53:8-53:21 |
542 | Int | 542 | Int |
543 | testdata/primes.lc 53:15-53:17 | 543 | testdata/primes.lc 53:15-53:17 |
544 | forall a . [a] -> Int -> a | 544 | forall a . [a] -> Int -> a |
545 | testdata/primes.lc 53:18-53:20 | 545 | testdata/primes.lc 53:18-53:21 |
546 | _b | 546 | _b |
547 | ------------ warnings | 547 | ------------ warnings |
548 | Uncovered pattern(s) at testdata/primes.lc:50:8: | 548 | Uncovered pattern(s) at testdata/primes.lc:50:8: |