summaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-05-12 03:02:50 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-05-12 03:02:50 +0200
commit3b66a4fdfbd74e9dc77b05536062129018fb0ade (patch)
tree7c420b856a3e9c1b3c47cfd8b78f3c4dd773f3d2 /testdata
parent7acd3bbffbf87f88d0b3510f44ff1c5b35cfd9d6 (diff)
update primes example
Diffstat (limited to 'testdata')
-rw-r--r--testdata/primes.lc2
-rw-r--r--testdata/primes.out10
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
53main = primes !! 10 -- TODO: 100 53main = 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 @@
1main :: Int 1main :: Int
2main = 31 2main = 739
3------------ desugared source code 3------------ desugared source code
4infixr 0 $ 4infixr 0 $
5 5
@@ -98,7 +98,7 @@ primes
98 (fromInt 0 == c)) 98 (fromInt 0 == c))
99 b 99 b
100 100
101main = _lhs main (_rhs (primes !! fromInt 10)) 101main = _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
156id = \a b -> _rhs b 156id = \a b -> _rhs b
157 157
158main :: Int 158main :: Int
159main = _rhs 31 159main = _rhs 739
160 160
161map :: forall a b . (a -> b) -> [a] -> [b] 161map :: forall a b . (a -> b) -> [a] -> [b]
162map = \a b c -> _rhs (foldr (\d e -> c d : e) []) 162map = \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]
539testdata/primes.lc 53:8-53:17 539testdata/primes.lc 53:8-53:17
540 Int -> Int 540 Int -> Int
541testdata/primes.lc 53:8-53:20 541testdata/primes.lc 53:8-53:21
542 Int 542 Int
543testdata/primes.lc 53:15-53:17 543testdata/primes.lc 53:15-53:17
544 forall a . [a] -> Int -> a 544 forall a . [a] -> Int -> a
545testdata/primes.lc 53:18-53:20 545testdata/primes.lc 53:18-53:21
546 _b 546 _b
547------------ warnings 547------------ warnings
548Uncovered pattern(s) at testdata/primes.lc:50:8: 548Uncovered pattern(s) at testdata/primes.lc:50:8: