diff options
author | Péter Diviánszky <divipp@gmail.com> | 2016-05-06 12:29:36 +0200 |
---|---|---|
committer | Péter Diviánszky <divipp@gmail.com> | 2016-05-06 12:29:36 +0200 |
commit | d353a29bb93d3105a763465300b28250117c3f40 (patch) | |
tree | 1517e23109d5e3c266b634b3c7af4dd4ca29e4d7 /testdata/typeclass.out | |
parent | 3430070058610b6aeab2543bc050bb1cf2e95d0c (diff) |
show typechecked source code in .out files & fix local function handling (again)
Diffstat (limited to 'testdata/typeclass.out')
-rw-r--r-- | testdata/typeclass.out | 68 |
1 files changed, 49 insertions, 19 deletions
diff --git a/testdata/typeclass.out b/testdata/typeclass.out index 36287148..7d3b916a 100644 --- a/testdata/typeclass.out +++ b/testdata/typeclass.out | |||
@@ -10,27 +10,27 @@ infixr 3 && | |||
10 | 10 | ||
11 | infixr 2 || | 11 | infixr 2 || |
12 | 12 | ||
13 | not = \(a :: _) -> case'Bool (\_ -> _) (_rhs True) (_rhs False) a | 13 | not = \(a :: _) -> case'Bool (\(_ :: _) -> _) (_rhs True) (_rhs False) a |
14 | 14 | ||
15 | (&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs False) (_rhs b) a | 15 | (&&) = \(a :: _) (b :: _) -> case'Bool (\(_ :: _) -> _) (_rhs False) (_rhs b) a |
16 | 16 | ||
17 | (||) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs b) (_rhs True) a | 17 | (||) = \(a :: _) (b :: _) -> case'Bool (\(_ :: _) -> _) (_rhs b) (_rhs True) a |
18 | 18 | ||
19 | 'Eq :: Type -> Constraint | 19 | 'Eq :: Type -> Constraint |
20 | 'Eq | 20 | 'Eq |
21 | = \(a :: _) -> match'Bool | 21 | = \(a :: _) -> match'Bool |
22 | (\_ -> _) | 22 | (\(_ :: _) -> _) |
23 | (_rhs 'CUnit) | 23 | (_rhs 'CUnit) |
24 | a | 24 | a |
25 | (_rhs ('CEmpty "no instance of 'Eq on ???")) | 25 | (_rhs ('CEmpty "no instance of 'Eq on ???")) |
26 | 26 | ||
27 | (==) :: forall a . Eq a => a -> a -> Bool | 27 | (==) :: forall a . Eq a => a -> a -> Bool |
28 | (==) | 28 | (==) |
29 | = \ @a @_ -> match'Bool | 29 | = \ @a @(_ :: _) -> match'Bool |
30 | (\_ -> _) | 30 | (\(_ :: _) -> _) |
31 | (_rhs | 31 | (_rhs |
32 | let | 32 | let |
33 | b = \(c :: _) (d :: _) -> case'Bool (\_ -> _) (_rhs (not d)) (_rhs d) c | 33 | b = \(c :: _) (d :: _) -> case'Bool (\(_ :: _) -> _) (_rhs (not d)) (_rhs d) c |
34 | in b) | 34 | in b) |
35 | a | 35 | a |
36 | (_rhs undefined) | 36 | (_rhs undefined) |
@@ -39,22 +39,52 @@ not = \(a :: _) -> case'Bool (\_ -> _) (_rhs True) (_rhs False) a | |||
39 | 39 | ||
40 | (==.) | 40 | (==.) |
41 | = \(a :: _) (b :: _) -> case'List | 41 | = \(a :: _) (b :: _) -> case'List |
42 | (\_ -> _) | 42 | (\(_ :: _) -> _) |
43 | (case'List (\_ -> _) (_rhs True) (\_ _ -> _rhs False) b) | 43 | (case'List (\(_ :: _) -> _) (_rhs True) (\(_ :: _) (_ :: _) -> _rhs False) b) |
44 | (\_ (c :: _) -> case'List | 44 | (\(_ :: _) (c :: _) -> case'List |
45 | (\_ -> _) | 45 | (\(_ :: _) -> _) |
46 | (_rhs False) | 46 | (_rhs False) |
47 | (\_ (d :: _) -> _rhs (c ==. d)) | 47 | (\(_ :: _) (d :: _) -> _rhs (c ==. d)) |
48 | b) | 48 | b) |
49 | a | 49 | a |
50 | ------------ trace | 50 | ------------ core code |
51 | not :: Bool -> Bool | 51 | && :: Bool -> Bool -> Bool |
52 | (&&) :: Bool -> Bool -> Bool | 52 | && = \a b -> case'Bool (\_ -> 'Bool) (_rhs False) (_rhs b) a |
53 | (||) :: Bool -> Bool -> Bool | 53 | |
54 | 'Eq :: Type -> Constraint | 54 | 'Eq :: Type -> Constraint |
55 | (==) :: forall a . Eq a => a -> a -> Bool | 55 | 'Eq |
56 | (/=) :: forall a . Eq a => a -> a -> Bool | 56 | = \a -> match'Bool |
57 | (==.) :: forall a b . [a] -> [b] -> Bool | 57 | (\_ -> 'Constraint) |
58 | (_rhs CUnit) | ||
59 | a | ||
60 | (_rhs (CEmpty "no instance of 'Eq on ???")) | ||
61 | |||
62 | /= :: forall a . Eq a => a -> a -> Bool | ||
63 | /= = \a b c d -> _rhs (not ((a == b) c d)) | ||
64 | |||
65 | == :: forall a . Eq a => a -> a -> Bool | ||
66 | == | ||
67 | = \a _ -> match'Bool | ||
68 | (\b -> b -> b -> 'Bool) | ||
69 | (_rhs (==)) | ||
70 | a | ||
71 | (_rhs (undefined (a -> a -> 'Bool))) | ||
72 | |||
73 | ==. :: forall a b . [a] -> [b] -> Bool | ||
74 | ==. | ||
75 | = \a b -> primFix | ||
76 | ([a] -> [b] -> 'Bool) | ||
77 | \c d e -> case'List | ||
78 | (\_ -> 'Bool) | ||
79 | (case'List (\_ -> 'Bool) (_rhs True) (\_ _ -> _rhs False) e) | ||
80 | (\_ f -> case'List (\_ -> 'Bool) (_rhs False) (\_ g -> _rhs (c f g)) e) | ||
81 | d | ||
82 | |||
83 | not :: Bool -> Bool | ||
84 | not = \a -> case'Bool (\_ -> 'Bool) (_rhs True) (_rhs False) a | ||
85 | |||
86 | || :: Bool -> Bool -> Bool | ||
87 | || = \a b -> case'Bool (\_ -> 'Bool) (_rhs b) (_rhs True) a | ||
58 | ------------ tooltips | 88 | ------------ tooltips |
59 | testdata/typeclass.lc 8:1-8:4 | 89 | testdata/typeclass.lc 8:1-8:4 |
60 | Bool -> Bool | 90 | Bool -> Bool |