summaryrefslogtreecommitdiff
path: root/testdata/Prelude.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/Prelude.out
parent95e006bf5afa8d3473e3fe4401f4c9316186a428 (diff)
mutual function definitions
Diffstat (limited to 'testdata/Prelude.out')
-rw-r--r--testdata/Prelude.out1012
1 files changed, 357 insertions, 655 deletions
diff --git a/testdata/Prelude.out b/testdata/Prelude.out
index ea497d05..d080c7e4 100644
--- a/testdata/Prelude.out
+++ b/testdata/Prelude.out
@@ -48,74 +48,70 @@ pi = _lhs pi (_rhs 3.141592653589793)
48 48
49zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [(a, b)] 49zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [(a, b)]
50zip 50zip
51 = _lhs 51 = primFix
52 zip 52 \(a :: forall (b :: _) (c :: _) . [b] -> [c] -> [(b, c)]) -> _lhs
53 \(a :: _) (b :: _) -> case'List 53 zip
54 (\(_ :: _) -> _) 54 \(d :: _) (e :: _) -> case'List
55 (_rhs [])
56 (\(c :: _) (d :: _) -> case'List
57 (\(_ :: _) -> _) 55 (\(_ :: _) -> _)
58 (_rhs []) 56 (_rhs [])
59 (\(e :: _) (f :: _) -> _rhs ((c, e) : zip d f)) 57 (\(f :: _) (g :: _) -> case'List
60 b) 58 (\(_ :: _) -> _)
61 a 59 (_rhs [])
60 (\(h :: _) (i :: _) -> _rhs ((f, h) : a g i))
61 e)
62 d
62 63
63unzip :: forall (a :: _) (b :: _) . [(a, b)] -> ([a], [b]) 64unzip :: forall (a :: _) (b :: _) . [(a, b)] -> ([a], [b])
64unzip 65unzip
65 = _lhs 66 = primFix
66 unzip 67 \(a :: forall (b :: _) (c :: _) . [(b, c)] -> ([b], [c])) -> _lhs
67 \(a :: _) -> case'List 68 unzip
68 (\(_ :: _) -> _) 69 \(d :: _) -> case'List
69 (_rhs ([], [])) 70 (\(_ :: _) -> _)
70 (\(b :: _) (c :: _) -> hlistConsCase 71 (_rhs ([], []))
71 _ 72 (\(e :: _) (f :: _) -> hlistConsCase
72 (\(d :: _) (e :: _) -> hlistConsCase
73 _ 73 _
74 (\(f :: _) (g :: _) -> hlistNilCase 74 (\(g :: _) (h :: _) -> hlistConsCase
75 _ 75 _
76 (_rhs 76 (\(i :: _) (j :: _) -> hlistNilCase
77 let 77 _
78 h = _lhs _bs_as (_rhs (unzip c)); 78 (_rhs
79 i 79 let
80 = _lhs 80 k = a f;
81 bs 81 l
82 (_rhs 82 = (\(n :: _) -> hlistConsCase
83 ((\(k :: _) -> hlistConsCase 83 _
84 _ 84 (\(_ :: _) (o :: _) -> hlistConsCase
85 (\(_ :: _) (l :: _) -> hlistConsCase
86 _
87 (\(m :: _) (n :: _) -> hlistNilCase _ m n)
88 l)
89 k)
90 h));
91 j
92 = _lhs
93 as
94 (_rhs
95 ((\(o :: _) -> hlistConsCase
96 _ 85 _
97 (\(p :: _) (q :: _) -> hlistConsCase 86 (\(p :: _) (q :: _) -> hlistNilCase _ p q)
98 _
99 (\(_ :: _) (r :: _) -> hlistNilCase _ p r)
100 q)
101 o) 87 o)
102 h)) 88 n)
103 in (d : j, f : i)) 89 k;
104 g) 90 m
91 = (\(r :: _) -> hlistConsCase
92 _
93 (\(s :: _) (t :: _) -> hlistConsCase
94 _
95 (\(_ :: _) (u :: _) -> hlistNilCase _ s u)
96 t)
97 r)
98 k
99 in (g : m, i : l))
100 j)
101 h)
105 e) 102 e)
106 b) 103 d
107 a
108 104
109filter 105filter
110 = _lhs 106 = primFix
111 filter 107 \(a :: _) -> _lhs
112 \(a :: _) (b :: _) -> case'List 108 filter
113 (\(_ :: _) -> _) 109 \(b :: _) (c :: _) -> case'List
114 (_rhs []) 110 (\(_ :: _) -> _)
115 (\(c :: _) (d :: _) -> _rhs 111 (_rhs [])
116 ((\(e :: _) -> case'Bool (\(_ :: _) -> _) (filter a d) (c : filter a d) e) 112 (\(d :: _) (e :: _) -> _rhs
117 (a c))) 113 ((\(f :: _) -> case'Bool (\(_ :: _) -> _) (a b e) (d : a b e) f) (b d)))
118 b 114 c
119 115
120tail :: forall (a :: _) . [a] -> [a] 116tail :: forall (a :: _) . [a] -> [a]
121tail 117tail
@@ -131,13 +127,14 @@ pairs :: forall (a :: _) . [a] -> [(a, a)]
131pairs = _lhs pairs \(a :: _) -> _rhs (zip a (tail a)) 127pairs = _lhs pairs \(a :: _) -> _rhs (zip a (tail a))
132 128
133foldl' 129foldl'
134 = _lhs 130 = primFix
135 foldl' 131 \(a :: _) -> _lhs
136 \(a :: _) (b :: _) (c :: _) -> case'List 132 foldl'
137 (\(_ :: _) -> _) 133 \(b :: _) (c :: _) (d :: _) -> case'List
138 (_rhs b) 134 (\(_ :: _) -> _)
139 (\(d :: _) (e :: _) -> _rhs (foldl' a (a b d) e)) 135 (_rhs c)
140 c 136 (\(e :: _) (f :: _) -> _rhs (a b (b c e) f))
137 d
141 138
142foldr1 139foldr1
143 = _lhs 140 = _lhs
@@ -149,77 +146,77 @@ foldr1
149 b 146 b
150 147
151split 148split
152 = _lhs 149 = primFix
153 split 150 \(a :: _) -> _lhs
154 \(a :: _) -> case'List 151 split
155 (\(_ :: _) -> _) 152 \(b :: _) -> case'List
156 (_rhs ([], [])) 153 (\(_ :: _) -> _)
157 (\(b :: _) (c :: _) -> _rhs 154 (_rhs ([], []))
158 let 155 (\(c :: _) (d :: _) -> _rhs
159 d = _lhs _bs_as (_rhs (split c)); 156 let
160 e 157 e = a d;
161 = _lhs 158 f
162 bs 159 = (\(h :: _) -> hlistConsCase
163 (_rhs 160 _
164 ((\(g :: _) -> hlistConsCase 161 (\(_ :: _) (i :: _) -> hlistConsCase
165 _ 162 _
166 (\(_ :: _) (h :: _) -> hlistConsCase 163 (\(j :: _) (k :: _) -> hlistNilCase _ j k)
167 _ 164 i)
168 (\(i :: _) (j :: _) -> hlistNilCase _ i j) 165 h)
169 h) 166 e;
170 g) 167 g
171 d)); 168 = (\(l :: _) -> hlistConsCase
172 f 169 _
173 = _lhs 170 (\(m :: _) (n :: _) -> hlistConsCase
174 as
175 (_rhs
176 ((\(k :: _) -> hlistConsCase
177 _ 171 _
178 (\(l :: _) (m :: _) -> hlistConsCase 172 (\(_ :: _) (o :: _) -> hlistNilCase _ m o)
179 _ 173 n)
180 (\(_ :: _) (n :: _) -> hlistNilCase _ l n) 174 l)
181 m) 175 e
182 k) 176 in (c : f, g))
183 d)) 177 b
184 in (b : e, f))
185 a
186 178
187mergeBy 179mergeBy
188 = _lhs 180 = primFix
189 mergeBy 181 \(a :: _) -> _lhs
190 \(a :: _) (b :: _) (c :: _) -> case'List 182 mergeBy
191 (\(_ :: _) -> _) 183 \(b :: _) (c :: _) (d :: _) -> case'List
192 (_rhs c)
193 (\(d :: _) (e :: _) -> case'List
194 (\(_ :: _) -> _) 184 (\(_ :: _) -> _)
195 (_rhs b) 185 (_rhs d)
196 (\(f :: _) (g :: _) -> _rhs 186 (\(e :: _) (f :: _) -> case'List
197 ((\(h :: _) -> case'Ordering 187 (\(_ :: _) -> _)
198 (\(_ :: _) -> _) 188 (_rhs c)
199 (d : mergeBy a e (f : g)) 189 (\(g :: _) (h :: _) -> _rhs
200 (f : mergeBy a (d : e) g) 190 ((\(i :: _) -> case'Ordering
201 (f : mergeBy a (d : e) g) 191 (\(_ :: _) -> _)
202 h) 192 (e : a b f (g : h))
203 (a d f))) 193 (g : a b (e : f) h)
204 c) 194 (g : a b (e : f) h)
205 b 195 i)
196 (b e g)))
197 d)
198 c
206 199
207sortBy 200sortBy
208 = _lhs 201 = primFix
209 sortBy 202 \(a :: _) -> _lhs
210 \(a :: _) (b :: _) -> case'List 203 sortBy
211 (\(_ :: _) -> _) 204 \(b :: _) (c :: _) -> case'List
212 (_rhs [])
213 (\(c :: _) (d :: _) -> case'List
214 (\(_ :: _) -> _) 205 (\(_ :: _) -> _)
215 (_rhs [c]) 206 (_rhs [])
216 (\(_ :: _) (_ :: _) -> _rhs 207 (\(d :: _) (e :: _) -> case'List
217 (uncurry (mergeBy a) ((sortBy a *** sortBy a) (split b)))) 208 (\(_ :: _) -> _)
218 d) 209 (_rhs [d])
219 b 210 (\(_ :: _) (_ :: _) -> _rhs (uncurry (mergeBy b) ((a b *** a b) (split c))))
211 e)
212 c
220 213
221iterate :: forall (a :: _) . (a -> a) -> a -> [a] 214iterate :: forall (a :: _) . (a -> a) -> a -> [a]
222iterate = _lhs iterate \(a :: _) (b :: _) -> _rhs (b : iterate a (a b)) 215iterate
216 = primFix
217 \(a :: forall (b :: _) . (b -> b) -> b -> [b]) -> _lhs
218 iterate
219 \(c :: _) (d :: _) -> _rhs (d : a c (c d))
223 220
224fst 221fst
225 = _lhs 222 = _lhs
@@ -269,17 +266,17 @@ data RecordC (_ :: [RecItem]) :: Type where
269 RecordCons :: forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a 266 RecordCons :: forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a
270 267
271isKeyC 268isKeyC
272 = _lhs 269 = primFix
273 isKeyC 270 \(a :: _) -> _lhs
274 \(a :: _) (b :: _) (c :: _) -> case'List 271 isKeyC
275 (\(_ :: _) -> _) 272 \(b :: _) (c :: _) (d :: _) -> case'List
276 (_rhs ('CEmpty ""))
277 (\(d :: _) (e :: _) -> case'RecItem
278 (\(_ :: _) -> _) 273 (\(_ :: _) -> _)
279 (\(f :: _) (g :: _) -> _rhs 274 (_rhs ('CEmpty ""))
280 (primIfThenElse (a == f) (b `'EqCTt` g) (isKeyC a b e))) 275 (\(e :: _) (f :: _) -> case'RecItem
281 d) 276 (\(_ :: _) -> _)
282 c 277 (\(g :: _) (h :: _) -> _rhs (primIfThenElse (b == g) (c `'EqCTt` h) (a b c f)))
278 e)
279 d
283 280
284fstTup = _lhs fstTup (_rhs (hlistConsCase (_ :: _) \(a :: _) (_ :: _) -> a)) 281fstTup = _lhs fstTup (_rhs (hlistConsCase (_ :: _) \(a :: _) (_ :: _) -> a))
285 282
@@ -289,30 +286,34 @@ project
289 :: forall (a :: _) (b :: [RecItem]) 286 :: forall (a :: _) (b :: [RecItem])
290 . forall (c :: String) -> isKeyC c a b => RecordC b -> a 287 . forall (c :: String) -> isKeyC c a b => RecordC b -> a
291project 288project
292 = _lhs 289 = primFix
293 project 290 \(a
294 \ @(a :: _) @(b :: _) (c :: _) @(_ :: _) (d :: _) -> case'List 291 :: forall (b :: _) (c :: [RecItem])
295 (\(_ :: _) -> _) 292 . forall (d :: String) -> isKeyC d b c => RecordC c -> b)
296 (_rhs undefined) 293 -> _lhs
297 (\(e :: _) (f :: _) -> case'RecItem 294 project
295 \ @(e :: _) @(f :: _) (g :: _) @(_ :: _) (h :: _) -> case'List
298 (\(_ :: _) -> _) 296 (\(_ :: _) -> _)
299 (\(g :: _) (_ :: _) -> case'RecordC 297 (_rhs undefined)
298 (\(i :: _) (j :: _) -> case'RecItem
300 (\(_ :: _) -> _) 299 (\(_ :: _) -> _)
301 (\(h :: _) -> case'Bool 300 (\(k :: _) (_ :: _) -> case'RecordC
302 (\(_ :: _) -> _) 301 (\(_ :: _) -> _)
303 (_rhs 302 (\(l :: _) -> case'Bool
304 (project 303 (\(_ :: _) -> _)
305 @a 304 (_rhs
306 @f 305 (a
307 c 306 @e
308 @(undefined @('CW (isKeyC c a f))) 307 @j
309 (RecordCons 308 g
310 (sndTup (unsafeCoerce @(_ :: _) @('HList (a : map recItemType f)) h))))) 309 @(undefined @('CW (isKeyC g e j)))
311 (_rhs (fstTup (unsafeCoerce @(_ :: _) @('HList (a : map recItemType f)) h))) 310 (RecordCons
312 (c == g)) 311 (sndTup (unsafeCoerce @(_ :: _) @('HList (e : map recItemType j)) l)))))
313 d) 312 (_rhs (fstTup (unsafeCoerce @(_ :: _) @('HList (e : map recItemType j)) l)))
314 e) 313 (g == k))
315 b 314 h)
315 i)
316 f
316 317
317rgb = _lhs rgb \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0) 318rgb = _lhs rgb \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0)
318 319
@@ -620,10 +621,7 @@ perspective
620 perspective 621 perspective
621 \(a :: _) (b :: _) (c :: _) (d :: _) -> _rhs 622 \(a :: _) (b :: _) (c :: _) (d :: _) -> _rhs
622 let 623 let
623 e = _lhs t (_rhs (a * tan (c / fromInt 2))); 624 e = a * tan (c / fromInt 2); f = fromInt 0 - e; g = d * e; h = fromInt 0 - g
624 f = _lhs b (_rhs (fromInt 0 - e));
625 g = _lhs r (_rhs (d * e));
626 h = _lhs l (_rhs (fromInt 0 - g))
627 in M44F 625 in M44F
628 (V4 (fromInt 2 * a / (g - h)) (fromInt 0) (fromInt 0) (fromInt 0)) 626 (V4 (fromInt 2 * a / (g - h)) (fromInt 0) (fromInt 0) (fromInt 0))
629 (V4 (fromInt 0) (fromInt 2 * a / (e - f)) (fromInt 0) (fromInt 0)) 627 (V4 (fromInt 0) (fromInt 2 * a / (e - f)) (fromInt 0) (fromInt 0))
@@ -642,7 +640,7 @@ rotMatrixZ
642 = _lhs 640 = _lhs
643 rotMatrixZ 641 rotMatrixZ
644 \(a :: _) -> _rhs 642 \(a :: _) -> _rhs
645 let b = _lhs c (_rhs (cos a)); c = _lhs s (_rhs (sin a)) in M44F 643 let b = cos a; c = sin a in M44F
646 (V4 b c (fromInt 0) (fromInt 0)) 644 (V4 b c (fromInt 0) (fromInt 0))
647 (V4 (fromInt 0 - c) b (fromInt 0) (fromInt 0)) 645 (V4 (fromInt 0 - c) b (fromInt 0) (fromInt 0))
648 (V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0)) 646 (V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0))
@@ -652,7 +650,7 @@ rotMatrixY
652 = _lhs 650 = _lhs
653 rotMatrixY 651 rotMatrixY
654 \(a :: _) -> _rhs 652 \(a :: _) -> _rhs
655 let b = _lhs c (_rhs (cos a)); c = _lhs s (_rhs (sin a)) in M44F 653 let b = cos a; c = sin a in M44F
656 (V4 b (fromInt 0) (fromInt 0 - c) (fromInt 0)) 654 (V4 b (fromInt 0) (fromInt 0 - c) (fromInt 0))
657 (V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0)) 655 (V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0))
658 (V4 c (fromInt 0) b (fromInt 0)) 656 (V4 c (fromInt 0) b (fromInt 0))
@@ -662,7 +660,7 @@ rotMatrixX
662 = _lhs 660 = _lhs
663 rotMatrixX 661 rotMatrixX
664 \(a :: _) -> _rhs 662 \(a :: _) -> _rhs
665 let b = _lhs c (_rhs (cos a)); c = _lhs s (_rhs (sin a)) in M44F 663 let b = cos a; c = sin a in M44F
666 (V4 (fromInt 1) (fromInt 0) (fromInt 0) (fromInt 0)) 664 (V4 (fromInt 1) (fromInt 0) (fromInt 0) (fromInt 0))
667 (V4 (fromInt 0) b c (fromInt 0)) 665 (V4 (fromInt 0) b c (fromInt 0))
668 (V4 (fromInt 0) (fromInt 0 - c) b (fromInt 0)) 666 (V4 (fromInt 0) (fromInt 0 - c) b (fromInt 0))
@@ -680,13 +678,10 @@ translateBefore4
680 translateBefore4 678 translateBefore4
681 \(a :: _) -> _rhs 679 \(a :: _) -> _rhs
682 let 680 let
683 b = _lhs r1 (_rhs (V4 (fromInt 1) (fromInt 0) (fromInt 0) (fromInt 0))); 681 b = V4 (fromInt 1) (fromInt 0) (fromInt 0) (fromInt 0);
684 c = _lhs r2 (_rhs (V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0))); 682 c = V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0);
685 d = _lhs r3 (_rhs (V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0))); 683 d = V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0);
686 e 684 e = V4 (swizzscalar a Sx) (swizzscalar a Sy) (swizzscalar a Sz) (fromInt 1)
687 = _lhs
688 r4
689 (_rhs (V4 (swizzscalar a Sx) (swizzscalar a Sy) (swizzscalar a Sz) (fromInt 1)))
690 in M44F b c d e 685 in M44F b c d e
691 686
692lookat 687lookat
@@ -703,59 +698,58 @@ lookat
703 ext0 698 ext0
704 \(i :: _) -> _rhs 699 \(i :: _) -> _rhs
705 (V4 (swizzscalar i Sx) (swizzscalar i Sy) (swizzscalar i Sz) (fromInt 0)); 700 (V4 (swizzscalar i Sx) (swizzscalar i Sy) (swizzscalar i Sz) (fromInt 0));
706 e = _lhs w (_rhs (normalize $ a - b)); 701 e = normalize $ a - b;
707 f = _lhs u (_rhs (normalize $ c `cross` e)); 702 f = normalize $ c `cross` e;
708 g = _lhs v (_rhs (e `cross` f)); 703 g = e `cross` f;
709 h 704 h
710 = _lhs 705 = transpose
711 r 706 $ M44F (d f) (d g) (d e) (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1))
712 (_rhs
713 (transpose
714 $ M44F (d f) (d g) (d e) (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1))))
715 in h .*. translateBefore4 (neg a) 707 in h .*. translateBefore4 (neg a)
716 708
717scale = _lhs scale \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0) 709scale = _lhs scale \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0)
718 710
719fromTo :: Float -> Float -> [Float] 711fromTo :: Float -> Float -> [Float]
720fromTo 712fromTo
721 = _lhs 713 = primFix
722 fromTo 714 \(a :: Float -> Float -> [Float]) -> _lhs
723 \(a :: _) (b :: _) -> case'Bool 715 fromTo
724 (\(_ :: _) -> _) 716 \(b :: _) (c :: _) -> case'Bool
725 (_rhs (a : fromTo (a + fromInt 1) b)) 717 (\(_ :: _) -> _)
726 (_rhs []) 718 (_rhs (b : a (b + fromInt 1) c))
727 (a > b) 719 (_rhs [])
720 (b > c)
728 721
729(!!) :: forall (a :: _) . [a] -> Int -> a 722(!!) :: forall (a :: _) . [a] -> Int -> a
730(!!) 723(!!)
731 = _lhs 724 = primFix
732 (!!) 725 \(a :: forall (b :: _) . [b] -> Int -> b) -> _lhs
733 \(a :: _) (b :: _) -> case'List 726 (!!)
734 (\(_ :: _) -> _) 727 \(c :: _) (d :: _) -> case'List
735 (_rhs undefined)
736 (\(c :: _) (d :: _) -> case'Bool
737 (\(_ :: _) -> _) 728 (\(_ :: _) -> _)
738 (_rhs (d !! (b - fromInt 1))) 729 (_rhs undefined)
739 (_rhs c) 730 (\(e :: _) (f :: _) -> case'Bool
740 (fromInt 0 == b)) 731 (\(_ :: _) -> _)
741 a 732 (_rhs (a f (d - fromInt 1)))
733 (_rhs e)
734 (fromInt 0 == d))
735 c
742------------ core code 736------------ core code
743!! :: forall a . [a] -> Int -> a 737!! :: forall a . [a] -> Int -> a
744!! 738!!
745 = primFix 739 = primFix
746 (forall a . [a] -> 'Int -> a) 740 _
747 \b c d e -> case'List 741 \a b c d -> case'List
748 (\_ -> c) 742 (\_ -> b)
749 (_rhs (undefined c)) 743 (_rhs (undefined b))
750 (\f g -> case'Bool 744 (\e f -> case'Bool
751 (\_ -> c) 745 (\_ -> b)
752 (_rhs (b c g (PrimSub 'Int TT e 1))) 746 (_rhs (a b f (d - 1)))
753 (_rhs f) 747 (_rhs e)
754 (isEQ (primCompareInt 0 e))) 748 (isEQ (primCompareInt 0 d)))
755 d 749 c
756 750
757$ :: forall a b . (a -> b) -> a -> b 751$ :: forall a b . (a -> b) -> a -> b
758$ = \_ _ -> _rhs \a b -> a b 752$ = \a b -> _rhs \c d -> c d
759 753
760% 754%
761 :: forall a (b :: Nat) 755 :: forall a (b :: Nat)
@@ -766,7 +760,7 @@ $ = \_ _ -> _rhs \a b -> a b
766%! = \a b c d e -> _rhs (PrimModS a ('VecScalar b a) b c TT d e) 760%! = \a b c d e -> _rhs (PrimModS a ('VecScalar b a) b c TT d e)
767 761
768& :: forall a b . a -> (a -> b) -> b 762& :: forall a b . a -> (a -> b) -> b
769& = \_ _ a b -> _rhs (b a) 763& = \a b c d -> _rhs (d c)
770 764
771&& :: Bool -> Bool -> Bool 765&& :: Bool -> Bool -> Bool
772&& = \a b -> _rhs (PrimAnd a b) 766&& = \a b -> _rhs (PrimAnd a b)
@@ -816,7 +810,7 @@ $ = \_ _ -> _rhs \a b -> a b
816-! = \a b c d -> _rhs (PrimSubS ('MatVecScalarElem a) a TT b c d) 810-! = \a b c d -> _rhs (PrimSubS ('MatVecScalarElem a) a TT b c d)
817 811
818. :: forall a b c . (b -> c) -> (a -> b) -> a -> c 812. :: forall a b c . (b -> c) -> (a -> b) -> a -> c
819. = \_ _ _ -> _rhs \a b c -> a (b c) 813. = \a b c -> _rhs \d e f -> d (e f)
820 814
821.* :: forall (a :: Nat) b (c :: Nat) . VecS b a -> Mat a c b -> Vec c b 815.* :: forall (a :: Nat) b (c :: Nat) . VecS b a -> Mat a c b -> Vec c b
822.* = \a b c d e -> _rhs (PrimMulVecMat a b c d e) 816.* = \a b c d e -> _rhs (PrimMulVecMat a b c d e)
@@ -868,8 +862,7 @@ $ = \_ _ -> _rhs \a b -> a b
868RecItem :: String -> Type -> RecItem 862RecItem :: String -> Type -> RecItem
869RecItem = <<0th constructor of 'RecItem>> 863RecItem = <<0th constructor of 'RecItem>>
870 864
871RecordCons 865RecordCons :: forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a
872 :: forall (a :: [RecItem]) . HList (map RecItem Type recItemType a) -> RecordC a
873RecordCons = <<0th constructor of 'RecordC>> 866RecordCons = <<0th constructor of 'RecordC>>
874 867
875abs :: forall a b (c :: Nat) . (Signed a, b ~ VecScalar c a) => b -> b 868abs :: forall a b (c :: Nat) . (Signed a, b ~ VecScalar c a) => b -> b
@@ -940,7 +933,7 @@ case'RecItem = \a b c -> <<case function of a type with 0 parameters>>
940case'RecordC 933case'RecordC
941 :: forall (a :: [RecItem]) 934 :: forall (a :: [RecItem])
942 . forall (b :: RecordC a -> Type) 935 . forall (b :: RecordC a -> Type)
943 -> (forall (c :: HList (map RecItem Type recItemType a)) -> b ('RecordCons c)) 936 -> (forall (c :: HList (map recItemType a)) -> b ('RecordCons c))
944 -> forall (d :: RecordC a) -> b d 937 -> forall (d :: RecordC a) -> b d
945case'RecordC = \_ a b c -> <<case function of a type with 1 parameters>> 938case'RecordC = \_ a b c -> <<case function of a type with 1 parameters>>
946 939
@@ -962,7 +955,7 @@ colorImage2
962colorImage2 = _rhs \a b c d e f -> ColorImage 2 a b c d e f 955colorImage2 = _rhs \a b c d e f -> ColorImage 2 a b c d e f
963 956
964const :: forall a b . a -> b -> a 957const :: forall a b . a -> b -> a
965const = \_ _ a _ -> _rhs a 958const = \a b c _ -> _rhs c
966 959
967cos :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a 960cos :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a
968cos = _rhs \a b c d -> PrimCos a b c d 961cos = _rhs \a b c d -> PrimCos a b c d
@@ -1009,7 +1002,7 @@ faceforward = _rhs \a b c d e f -> PrimFaceForward a b c d e f
1009filter :: forall a . (a -> Bool) -> [a] -> [a] 1002filter :: forall a . (a -> Bool) -> [a] -> [a]
1010filter 1003filter
1011 = \a -> primFix 1004 = \a -> primFix
1012 ((a -> 'Bool) -> [a] -> [a]) 1005 _
1013 \b c d -> case'List 1006 \b c d -> case'List
1014 (\_ -> [a]) 1007 (\_ -> [a])
1015 (_rhs []) 1008 (_rhs [])
@@ -1028,7 +1021,7 @@ floor = _rhs \a b c d -> PrimFloor a b c d
1028foldl' :: forall a b . (a -> b -> a) -> a -> [b] -> a 1021foldl' :: forall a b . (a -> b -> a) -> a -> [b] -> a
1029foldl' 1022foldl'
1030 = \a b -> primFix 1023 = \a b -> primFix
1031 ((a -> b -> a) -> a -> [b] -> a) 1024 _
1032 \c d e f -> case'List (\_ -> a) (_rhs e) (\g h -> _rhs (c d (d e g) h)) f 1025 \c d e f -> case'List (\_ -> a) (_rhs e) (\g h -> _rhs (c d (d e g) h)) f
1033 1026
1034foldr1 :: forall a . (a -> a -> a) -> [a] -> a 1027foldr1 :: forall a . (a -> a -> a) -> [a] -> a
@@ -1036,7 +1029,7 @@ foldr1
1036 = \a b c -> case'List 1029 = \a b c -> case'List
1037 (\_ -> a) 1030 (\_ -> a)
1038 (_rhs (undefined a)) 1031 (_rhs (undefined a))
1039 (\d e -> _rhs (foldr a a b d e)) 1032 (\d e -> _rhs (foldr b d e))
1040 c 1033 c
1041 1034
1042fract :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a 1035fract :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a
@@ -1045,12 +1038,21 @@ fract = _rhs \a b c d -> PrimFract a b c d
1045fromTo :: Float -> Float -> [Float] 1038fromTo :: Float -> Float -> [Float]
1046fromTo 1039fromTo
1047 = primFix 1040 = primFix
1048 ('Float -> 'Float -> ['Float]) 1041 _
1049 \a b c -> case'Bool 1042 \a b c -> case'Bool
1050 (\_ -> ['Float]) 1043 (\_ -> ['Float])
1051 (_rhs (b : a (PrimAdd 'Float TT b 1.0) c)) 1044 (_rhs (b : a (b + 1.0) c))
1052 (_rhs []) 1045 (_rhs [])
1053 (PrimGreaterThan 'Float 1 'Float 'Bool TT TT TT b c) 1046 (PrimGreaterThan
1047 ('VecScalar 1 'Float)
1048 1
1049 'Float
1050 ('VecScalar 1 'Bool)
1051 TT
1052 TT
1053 TT
1054 b
1055 c)
1054 1056
1055fst :: forall a b . (a, b) -> a 1057fst :: forall a b . (a, b) -> a
1056fst 1058fst
@@ -1090,14 +1092,13 @@ isInf = _rhs \a b c d e f -> PrimIsInf a b c d e f
1090isKeyC :: String -> Type -> [RecItem] -> Constraint 1092isKeyC :: String -> Type -> [RecItem] -> Constraint
1091isKeyC 1093isKeyC
1092 = primFix 1094 = primFix
1093 ('String -> Type -> ['RecItem] -> 'Constraint) 1095 _
1094 \a b c d -> case'List 1096 \a b c d -> case'List
1095 (\_ -> 'Constraint) 1097 (\_ -> 'Constraint)
1096 (_rhs (CEmpty "")) 1098 (_rhs (CEmpty ""))
1097 (\e f -> case'RecItem 1099 (\e f -> case'RecItem
1098 (\_ -> 'Constraint) 1100 (\_ -> 'Constraint)
1099 (\g h -> _rhs 1101 (\g h -> _rhs (primIfThenElse 'Constraint (b == g) (c ~ h) (a b c f)))
1100 (primIfThenElse 'Constraint (isEQ (primCompareString b g)) (c ~ h) (a b c f)))
1101 e) 1102 e)
1102 d 1103 d
1103 1104
@@ -1107,8 +1108,7 @@ isNan
1107isNan = _rhs \a b c d e f -> PrimIsNan a b c d e f 1108isNan = _rhs \a b c d e f -> PrimIsNan a b c d e f
1108 1109
1109iterate :: forall a . (a -> a) -> a -> [a] 1110iterate :: forall a . (a -> a) -> a -> [a]
1110iterate 1111iterate = primFix _ \a b c d -> _rhs (d : a b c (c d))
1111 = primFix (forall a . (a -> a) -> a -> [a]) \b c d e -> _rhs (e : b c d (d e))
1112 1112
1113length :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> Float 1113length :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> Float
1114length = _rhs \a b c d -> PrimLength a b c d 1114length = _rhs \a b c d -> PrimLength a b c d
@@ -1135,127 +1135,33 @@ lookat
1135 4 1135 4
1136 'Float 1136 'Float
1137 (M44F 1137 (M44F
1138 (V4 1138 (ext0
1139 (swizzscalar 1139 (PrimNormalize
1140 'Float 1140 ('VecScalar 3 'Float)
1141 3 1141 3
1142 (PrimNormalize 1142 TT
1143 ('VecS 'Float 3) 1143 (PrimCross
1144 3
1145 TT
1146 (PrimCross
1147 ('VecS 'Float 3)
1148 TT
1149 c
1150 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))))
1151 Sx)
1152 (swizzscalar
1153 'Float
1154 3
1155 (PrimNormalize
1156 ('VecS 'Float 3) 1144 ('VecS 'Float 3)
1157 3
1158 TT 1145 TT
1159 (PrimCross 1146 c
1160 ('VecS 'Float 3) 1147 (PrimNormalize ('VecScalar 3 'Float) 3 TT (a - b)))))
1161 TT 1148 (ext0
1162 c 1149 (PrimCross
1163 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b)))) 1150 ('VecS 'Float 3)
1164 Sy) 1151 TT
1165 (swizzscalar 1152 (PrimNormalize ('VecScalar 3 'Float) 3 TT (a - b))
1166 'Float
1167 3
1168 (PrimNormalize 1153 (PrimNormalize
1169 ('VecS 'Float 3) 1154 ('VecScalar 3 'Float)
1170 3 1155 3
1171 TT 1156 TT
1172 (PrimCross 1157 (PrimCross
1173 ('VecS 'Float 3) 1158 ('VecS 'Float 3)
1174 TT 1159 TT
1175 c 1160 c
1176 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b)))) 1161 (PrimNormalize ('VecScalar 3 'Float) 3 TT (a - b))))))
1177 Sz) 1162 (ext0 (PrimNormalize ('VecScalar 3 'Float) 3 TT (a - b)))
1178 0.0)
1179 (V4
1180 (swizzscalar
1181 'Float
1182 3
1183 (PrimCross
1184 ('VecS 'Float 3)
1185 TT
1186 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1187 (PrimNormalize
1188 ('VecS 'Float 3)
1189 3
1190 TT
1191 (PrimCross
1192 ('VecS 'Float 3)
1193 TT
1194 c
1195 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b)))))
1196 Sx)
1197 (swizzscalar
1198 'Float
1199 3
1200 (PrimCross
1201 ('VecS 'Float 3)
1202 TT
1203 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1204 (PrimNormalize
1205 ('VecS 'Float 3)
1206 3
1207 TT
1208 (PrimCross
1209 ('VecS 'Float 3)
1210 TT
1211 c
1212 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b)))))
1213 Sy)
1214 (swizzscalar
1215 'Float
1216 3
1217 (PrimCross
1218 ('VecS 'Float 3)
1219 TT
1220 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1221 (PrimNormalize
1222 ('VecS 'Float 3)
1223 3
1224 TT
1225 (PrimCross
1226 ('VecS 'Float 3)
1227 TT
1228 c
1229 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b)))))
1230 Sz)
1231 0.0)
1232 (V4
1233 (swizzscalar
1234 'Float
1235 3
1236 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1237 Sx)
1238 (swizzscalar
1239 'Float
1240 3
1241 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1242 Sy)
1243 (swizzscalar
1244 'Float
1245 3
1246 (PrimNormalize ('VecS 'Float 3) 3 TT (PrimSub ('VecS 'Float 3) TT a b))
1247 Sz)
1248 0.0)
1249 (V4 0.0 0.0 0.0 1.0))) 1163 (V4 0.0 0.0 0.0 1.0)))
1250 (M44F 1164 (translateBefore4 (neg a)))
1251 (V4 1.0 0.0 0.0 0.0)
1252 (V4 0.0 1.0 0.0 0.0)
1253 (V4 0.0 0.0 1.0 0.0)
1254 (V4
1255 (swizzscalar 'Float 3 (PrimNeg ('VecS 'Float 3) TT a) Sx)
1256 (swizzscalar 'Float 3 (PrimNeg ('VecS 'Float 3) TT a) Sy)
1257 (swizzscalar 'Float 3 (PrimNeg ('VecS 'Float 3) TT a) Sz)
1258 1.0)))
1259 1165
1260maroon :: VecS Float 4 1166maroon :: VecS Float 4
1261maroon = _rhs (V4 0.5 0.0 0.0 1.0) 1167maroon = _rhs (V4 0.5 0.0 0.0 1.0)
@@ -1275,7 +1181,7 @@ max = _rhs \a b c d e f g -> PrimMax a b c d e f g
1275mergeBy :: forall a . (a -> a -> Ordering) -> [a] -> [a] -> [a] 1181mergeBy :: forall a . (a -> a -> Ordering) -> [a] -> [a] -> [a]
1276mergeBy 1182mergeBy
1277 = \a -> primFix 1183 = \a -> primFix
1278 ((a -> a -> 'Ordering) -> [a] -> [a] -> [a]) 1184 _
1279 \b c d e -> case'List 1185 \b c d e -> case'List
1280 (\_ -> [a]) 1186 (\_ -> [a])
1281 (_rhs e) 1187 (_rhs e)
@@ -1353,188 +1259,31 @@ perspective
1353 = \a b c d -> _rhs 1259 = \a b c d -> _rhs
1354 (M44F 1260 (M44F
1355 (V4 1261 (V4
1356 (PrimDiv 1262 (2.0 * a
1357 'Float 1263 / (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))
1358 'Float 1264 - (0.0 - (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))))))
1359 1
1360 TT
1361 TT
1362 (PrimMul 'Float TT 2.0 a)
1363 (PrimSub
1364 'Float
1365 TT
1366 (PrimMul
1367 'Float
1368 TT
1369 d
1370 (PrimMul
1371 'Float
1372 TT
1373 a
1374 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))
1375 (PrimSub
1376 'Float
1377 TT
1378 0.0
1379 (PrimMul
1380 'Float
1381 TT
1382 d
1383 (PrimMul
1384 'Float
1385 TT
1386 a
1387 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))))))
1388 0.0 1265 0.0
1389 0.0 1266 0.0
1390 0.0) 1267 0.0)
1391 (V4 1268 (V4
1392 0.0 1269 0.0
1393 (PrimDiv 1270 (2.0 * a
1394 'Float 1271 / (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)
1395 'Float 1272 - (0.0 - (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)))))
1396 1
1397 TT
1398 TT
1399 (PrimMul 'Float TT 2.0 a)
1400 (PrimSub
1401 'Float
1402 TT
1403 (PrimMul
1404 'Float
1405 TT
1406 a
1407 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))
1408 (PrimSub
1409 'Float
1410 TT
1411 0.0
1412 (PrimMul
1413 'Float
1414 TT
1415 a
1416 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))))
1417 0.0 1273 0.0
1418 0.0) 1274 0.0)
1419 (V4 1275 (V4
1420 (PrimDiv 1276 (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))
1421 'Float 1277 + (0.0 - (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))))
1422 'Float 1278 / (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))
1423 1 1279 - (0.0 - (d * (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0))))))
1424 TT 1280 (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)
1425 TT 1281 + (0.0 - (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)))
1426 (PrimAdd 1282 / (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)
1427 'Float 1283 - (0.0 - (a * PrimTan ('VecScalar 1 'Float) 1 TT (c / 2.0)))))
1428 TT 1284 (0.0 - (b + a / (b - a)))
1429 (PrimMul 1285 (0.0 - 1.0))
1430 'Float 1286 (V4 0.0 0.0 (0.0 - (2.0 * b * a / (b - a))) 0.0))
1431 TT
1432 d
1433 (PrimMul
1434 'Float
1435 TT
1436 a
1437 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))
1438 (PrimSub
1439 'Float
1440 TT
1441 0.0
1442 (PrimMul
1443 'Float
1444 TT
1445 d
1446 (PrimMul
1447 'Float
1448 TT
1449 a
1450 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))))
1451 (PrimSub
1452 'Float
1453 TT
1454 (PrimMul
1455 'Float
1456 TT
1457 d
1458 (PrimMul
1459 'Float
1460 TT
1461 a
1462 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))
1463 (PrimSub
1464 'Float
1465 TT
1466 0.0
1467 (PrimMul
1468 'Float
1469 TT
1470 d
1471 (PrimMul
1472 'Float
1473 TT
1474 a
1475 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))))))
1476 (PrimDiv
1477 'Float
1478 'Float
1479 1
1480 TT
1481 TT
1482 (PrimAdd
1483 'Float
1484 TT
1485 (PrimMul
1486 'Float
1487 TT
1488 a
1489 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))
1490 (PrimSub
1491 'Float
1492 TT
1493 0.0
1494 (PrimMul
1495 'Float
1496 TT
1497 a
1498 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))))
1499 (PrimSub
1500 'Float
1501 TT
1502 (PrimMul
1503 'Float
1504 TT
1505 a
1506 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0)))
1507 (PrimSub
1508 'Float
1509 TT
1510 0.0
1511 (PrimMul
1512 'Float
1513 TT
1514 a
1515 (PrimTan 'Float 1 TT (PrimDiv 'Float 'Float 1 TT TT c 2.0))))))
1516 (PrimSub
1517 'Float
1518 TT
1519 0.0
1520 (PrimDiv 'Float 'Float 1 TT TT (PrimAdd 'Float TT b a) (PrimSub 'Float TT b a)))
1521 -1.0)
1522 (V4
1523 0.0
1524 0.0
1525 (PrimSub
1526 'Float
1527 TT
1528 0.0
1529 (PrimDiv
1530 'Float
1531 'Float
1532 1
1533 TT
1534 TT
1535 (PrimMul 'Float TT (PrimMul 'Float TT 2.0 b) a)
1536 (PrimSub 'Float TT b a)))
1537 0.0))
1538 1287
1539pi :: Float 1288pi :: Float
1540pi = _rhs 3.141592653589793 1289pi = _rhs 3.141592653589793
@@ -1547,47 +1296,43 @@ project
1547 . forall (c :: String) -> isKeyC c a b => RecordC b -> a 1296 . forall (c :: String) -> isKeyC c a b => RecordC b -> a
1548project 1297project
1549 = primFix 1298 = primFix
1550 (forall a (b :: [RecItem]) 1299 _
1551 . forall (c :: String) -> isKeyC c a b => 'RecordC b -> a) 1300 \a b c d _ e -> case'List
1552 \d e f g _ h -> case'List 1301 (\_ -> b)
1553 (\_ -> e) 1302 (_rhs (undefined b))
1554 (_rhs (undefined e)) 1303 (\f g -> case'RecItem
1555 (\i j -> case'RecItem 1304 (\_ -> b)
1556 (\_ -> e) 1305 (\h _ -> case'RecordC
1557 (\k _ -> case'RecordC 1306 (\_ -> b)
1558 (\_ -> e) 1307 (\i -> case'Bool
1559 (\l -> case'Bool 1308 (\_ -> b)
1560 (\_ -> e)
1561 (_rhs 1309 (_rhs
1562 (d 1310 (a
1563 e 1311 b
1564 j
1565 g 1312 g
1566 (undefined ('CW (isKeyC g e j))) 1313 d
1314 (undefined ('CW (isKeyC d b g)))
1567 (RecordCons 1315 (RecordCons
1568 (hlistConsCase 1316 (hlistConsCase
1569 e 1317 b
1570 (map 'RecItem Type recItemType j) 1318 (map recItemType g)
1571 ('HList (map 'RecItem Type recItemType j)) 1319 ('HList (map recItemType g))
1572 (\_ m -> m) 1320 (\_ j -> j)
1573 (unsafeCoerce 1321 (unsafeCoerce
1574 ('HList (map 'RecItem Type recItemType f)) 1322 ('HList (map recItemType c))
1575 ('HList (e : map 'RecItem Type recItemType j)) 1323 ('HList (b : map recItemType g))
1576 l))))) 1324 i)))))
1577 (_rhs 1325 (_rhs
1578 (hlistConsCase 1326 (hlistConsCase
1579 e 1327 b
1580 (map 'RecItem Type recItemType j) 1328 (map recItemType g)
1581 e 1329 b
1582 (\n _ -> n) 1330 (\k _ -> k)
1583 (unsafeCoerce 1331 (unsafeCoerce ('HList (map recItemType c)) ('HList (b : map recItemType g)) i)))
1584 ('HList (map 'RecItem Type recItemType f)) 1332 (isEQ (primCompareString d h)))
1585 ('HList (e : map 'RecItem Type recItemType j)) 1333 e)
1586 l))) 1334 f)
1587 (isEQ (primCompareString g k))) 1335 c
1588 h)
1589 i)
1590 f
1591 1336
1592purple :: VecS Float 4 1337purple :: VecS Float 4
1593purple = _rhs (V4 0.5 0.0 0.5 1.0) 1338purple = _rhs (V4 0.5 0.0 0.5 1.0)
@@ -1615,11 +1360,15 @@ rotMatrixX
1615 = \a -> _rhs 1360 = \a -> _rhs
1616 (M44F 1361 (M44F
1617 (V4 1.0 0.0 0.0 0.0) 1362 (V4 1.0 0.0 0.0 0.0)
1618 (V4 0.0 (PrimCos 'Float 1 TT a) (PrimSin 'Float 1 TT a) 0.0)
1619 (V4 1363 (V4
1620 0.0 1364 0.0
1621 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT a)) 1365 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1622 (PrimCos 'Float 1 TT a) 1366 (PrimSin ('VecScalar 1 'Float) 1 TT a)
1367 0.0)
1368 (V4
1369 0.0
1370 (0.0 - PrimSin ('VecScalar 1 'Float) 1 TT a)
1371 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1623 0.0) 1372 0.0)
1624 (V4 0.0 0.0 0.0 1.0)) 1373 (V4 0.0 0.0 0.0 1.0))
1625 1374
@@ -1628,22 +1377,30 @@ rotMatrixY
1628 = \a -> _rhs 1377 = \a -> _rhs
1629 (M44F 1378 (M44F
1630 (V4 1379 (V4
1631 (PrimCos 'Float 1 TT a) 1380 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1632 0.0 1381 0.0
1633 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT a)) 1382 (0.0 - PrimSin ('VecScalar 1 'Float) 1 TT a)
1634 0.0) 1383 0.0)
1635 (V4 0.0 1.0 0.0 0.0) 1384 (V4 0.0 1.0 0.0 0.0)
1636 (V4 (PrimSin 'Float 1 TT a) 0.0 (PrimCos 'Float 1 TT a) 0.0) 1385 (V4
1386 (PrimSin ('VecScalar 1 'Float) 1 TT a)
1387 0.0
1388 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1389 0.0)
1637 (V4 0.0 0.0 0.0 1.0)) 1390 (V4 0.0 0.0 0.0 1.0))
1638 1391
1639rotMatrixZ :: VecScalar 1 Float -> Mat 4 4 Float 1392rotMatrixZ :: VecScalar 1 Float -> Mat 4 4 Float
1640rotMatrixZ 1393rotMatrixZ
1641 = \a -> _rhs 1394 = \a -> _rhs
1642 (M44F 1395 (M44F
1643 (V4 (PrimCos 'Float 1 TT a) (PrimSin 'Float 1 TT a) 0.0 0.0)
1644 (V4 1396 (V4
1645 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT a)) 1397 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1646 (PrimCos 'Float 1 TT a) 1398 (PrimSin ('VecScalar 1 'Float) 1 TT a)
1399 0.0
1400 0.0)
1401 (V4
1402 (0.0 - PrimSin ('VecScalar 1 'Float) 1 TT a)
1403 (PrimCos ('VecScalar 1 'Float) 1 TT a)
1647 0.0 1404 0.0
1648 0.0) 1405 0.0)
1649 (V4 0.0 0.0 1.0 0.0) 1406 (V4 0.0 0.0 1.0 0.0)
@@ -1652,43 +1409,7 @@ rotMatrixZ
1652rotationEuler :: Float -> Float -> Float -> Mat 4 4 Float 1409rotationEuler :: Float -> Float -> Float -> Mat 4 4 Float
1653rotationEuler 1410rotationEuler
1654 = \a b c -> _rhs 1411 = \a b c -> _rhs
1655 (PrimMulMatMat 1412 (PrimMulMatMat 4 4 'Float 4 (rotMatrixY a .*. rotMatrixX b) (rotMatrixZ c))
1656 4
1657 4
1658 'Float
1659 4
1660 (PrimMulMatMat
1661 4
1662 4
1663 'Float
1664 4
1665 (M44F
1666 (V4
1667 (PrimCos 'Float 1 TT a)
1668 0.0
1669 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT a))
1670 0.0)
1671 (V4 0.0 1.0 0.0 0.0)
1672 (V4 (PrimSin 'Float 1 TT a) 0.0 (PrimCos 'Float 1 TT a) 0.0)
1673 (V4 0.0 0.0 0.0 1.0))
1674 (M44F
1675 (V4 1.0 0.0 0.0 0.0)
1676 (V4 0.0 (PrimCos 'Float 1 TT b) (PrimSin 'Float 1 TT b) 0.0)
1677 (V4
1678 0.0
1679 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT b))
1680 (PrimCos 'Float 1 TT b)
1681 0.0)
1682 (V4 0.0 0.0 0.0 1.0)))
1683 (M44F
1684 (V4 (PrimCos 'Float 1 TT c) (PrimSin 'Float 1 TT c) 0.0 0.0)
1685 (V4
1686 (PrimSub 'Float TT 0.0 (PrimSin 'Float 1 TT c))
1687 (PrimCos 'Float 1 TT c)
1688 0.0
1689 0.0)
1690 (V4 0.0 0.0 1.0 0.0)
1691 (V4 0.0 0.0 0.0 1.0)))
1692 1413
1693round :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a 1414round :: forall a (b :: Nat) . (a ~ VecScalar b Float) => a -> a
1694round = _rhs \a b c d -> PrimRound a b c d 1415round = _rhs \a b c d -> PrimRound a b c d
@@ -1751,27 +1472,21 @@ sndTup = \a b -> _rhs \c -> hlistConsCase a b ('HList b) (\_ d -> d) c
1751sortBy :: forall a . (a -> a -> Ordering) -> [a] -> [a] 1472sortBy :: forall a . (a -> a -> Ordering) -> [a] -> [a]
1752sortBy 1473sortBy
1753 = \a -> primFix 1474 = \a -> primFix
1754 ((a -> a -> 'Ordering) -> [a] -> [a]) 1475 _
1755 \b c d -> case'List 1476 \b c d -> case'List
1756 (\_ -> [a]) 1477 (\_ -> [a])
1757 (_rhs []) 1478 (_rhs [])
1758 (\e f -> case'List 1479 (\e f -> case'List
1759 (\_ -> [a]) 1480 (\_ -> [a])
1760 (_rhs [e]) 1481 (_rhs [e])
1761 (\_ _ -> _rhs 1482 (\_ _ -> _rhs (uncurry (mergeBy c) ((b c *** b c) (split d))))
1762 (uncurry
1763 [a]
1764 [a]
1765 [a]
1766 (mergeBy a c)
1767 (([a] *** [a]) [a] [a] (b c) (b c) (split a d))))
1768 f) 1483 f)
1769 d 1484 d
1770 1485
1771split :: forall a . [a] -> ([a], [a]) 1486split :: forall a . [a] -> ([a], [a])
1772split 1487split
1773 = \a -> primFix 1488 = \a -> primFix
1774 ([a] -> ' ([a], [a])) 1489 _
1775 \b c -> case'List 1490 \b c -> case'List
1776 (\_ -> ' ([a], [a])) 1491 (\_ -> ' ([a], [a]))
1777 (_rhs ([], [])) 1492 (_rhs ([], []))
@@ -1843,39 +1558,39 @@ uncurry
1843unzip :: forall a b . [(a, b)] -> ([a], [b]) 1558unzip :: forall a b . [(a, b)] -> ([a], [b])
1844unzip 1559unzip
1845 = primFix 1560 = primFix
1846 (forall a b . [' (a, b)] -> ' ([a], [b])) 1561 _
1847 \c d e f -> case'List 1562 \a b c d -> case'List
1848 (\_ -> ' ([d], [e])) 1563 (\_ -> ' ([b], [c]))
1849 (_rhs ([], [])) 1564 (_rhs ([], []))
1850 (\g h -> hlistConsCase 1565 (\e f -> hlistConsCase
1851 d 1566 b
1852 [e] 1567 [c]
1853 ' ([d], [e]) 1568 ' ([b], [c])
1854 (\i j -> hlistConsCase 1569 (\g h -> hlistConsCase
1855 e 1570 c
1856 [] 1571 []
1857 ' ([d], [e]) 1572 ' ([b], [c])
1858 (\k l -> hlistNilCase 1573 (\i j -> hlistNilCase
1859 ' ([d], [e]) 1574 ' ([b], [c])
1860 (_rhs 1575 (_rhs
1861 (i 1576 (g
1862 : hlistConsCase 1577 : hlistConsCase
1863 [d] 1578 [b]
1864 [[e]] 1579 [[c]]
1865 [d] 1580 [b]
1866 (\m n -> hlistConsCase [e] [] [d] (\_ o -> hlistNilCase [d] m o) n) 1581 (\k l -> hlistConsCase [c] [] [b] (\_ m -> hlistNilCase [b] k m) l)
1867 (c d e h) 1582 (a b c f)
1868 , k 1583 , i
1869 : hlistConsCase 1584 : hlistConsCase
1870 [d] 1585 [b]
1871 [[e]] 1586 [[c]]
1872 [e] 1587 [c]
1873 (\_ p -> hlistConsCase [e] [] [e] (\q r -> hlistNilCase [e] q r) p) 1588 (\_ n -> hlistConsCase [c] [] [c] (\o p -> hlistNilCase [c] o p) n)
1874 (c d e h))) 1589 (a b c f)))
1875 l) 1590 j)
1876 j) 1591 h)
1877 g) 1592 e)
1878 f 1593 d
1879 1594
1880v3FToV4F :: Vec 3 Float -> VecS Float 4 1595v3FToV4F :: Vec 3 Float -> VecS Float 4
1881v3FToV4F 1596v3FToV4F
@@ -1901,16 +1616,16 @@ yellow = _rhs (V4 1.0 1.0 0.0 1.0)
1901zip :: forall a b . [a] -> [b] -> [(a, b)] 1616zip :: forall a b . [a] -> [b] -> [(a, b)]
1902zip 1617zip
1903 = primFix 1618 = primFix
1904 (forall a b . [a] -> [b] -> [' (a, b)]) 1619 _
1905 \c d e f g -> case'List 1620 \a b c d e -> case'List
1906 (\_ -> [' (d, e)]) 1621 (\_ -> [' (b, c)])
1907 (_rhs []) 1622 (_rhs [])
1908 (\h i -> case'List 1623 (\f g -> case'List
1909 (\_ -> [' (d, e)]) 1624 (\_ -> [' (b, c)])
1910 (_rhs []) 1625 (_rhs [])
1911 (\j k -> _rhs ((h, j) : c d e i k)) 1626 (\h i -> _rhs ((f, h) : a b c g i))
1912 g) 1627 e)
1913 f 1628 d
1914 1629
1915|| :: Bool -> Bool -> Bool 1630|| :: Bool -> Bool -> Bool
1916|| = \a b -> _rhs (PrimOr a b) 1631|| = \a b -> _rhs (PrimOr a b)
@@ -1978,8 +1693,6 @@ testdata/Prelude.lc 31:8-31:11
1978 Type 1693 Type
1979testdata/Prelude.lc 31:8-31:29 1694testdata/Prelude.lc 31:8-31:29
1980 Type | Type 1695 Type | Type
1981testdata/Prelude.lc 31:8-34:39
1982 forall a b . [a] -> [b] -> [(a, b)]
1983testdata/Prelude.lc 31:9-31:10 1696testdata/Prelude.lc 31:9-31:10
1984 _d 1697 _d
1985testdata/Prelude.lc 31:15-31:18 1698testdata/Prelude.lc 31:15-31:18
@@ -2034,8 +1747,6 @@ testdata/Prelude.lc 36:10-36:17
2034 Type 1747 Type
2035testdata/Prelude.lc 36:10-36:30 1748testdata/Prelude.lc 36:10-36:30
2036 Type | Type 1749 Type | Type
2037testdata/Prelude.lc 36:10-39:27
2038 forall a b . [(a, b)] -> ([a], [b])
2039testdata/Prelude.lc 36:11-36:16 1750testdata/Prelude.lc 36:11-36:16
2040 Type 1751 Type
2041testdata/Prelude.lc 36:12-36:13 1752testdata/Prelude.lc 36:12-36:13
@@ -2376,8 +2087,6 @@ testdata/Prelude.lc 71:67-71:69
2376 _k 2087 _k
2377testdata/Prelude.lc 73:12-73:32 2088testdata/Prelude.lc 73:12-73:32
2378 Type 2089 Type
2379testdata/Prelude.lc 73:12-74:35
2380 forall a . (a -> a) -> a -> [a]
2381testdata/Prelude.lc 73:13-73:14 2090testdata/Prelude.lc 73:13-73:14
2382 _b 2091 _b
2383testdata/Prelude.lc 73:18-73:19 2092testdata/Prelude.lc 73:18-73:19
@@ -2470,8 +2179,8 @@ testdata/Prelude.lc 126:21-126:30
2470testdata/Prelude.lc 126:22-126:29 2179testdata/Prelude.lc 126:22-126:29
2471 Type | Type | Type 2180 Type | Type | Type
2472testdata/Prelude.lc 127:7-127:17 2181testdata/Prelude.lc 127:7-127:17
2473 forall (a :: [RecItem]) 2182 forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a | RecordC
2474 . HList (map RecItem Type recItemType a) -> RecordC a | RecordC _c | Type | Type 2183 _c | Type | Type
2475testdata/Prelude.lc 127:19-127:24 2184testdata/Prelude.lc 127:19-127:24
2476 [Type] -> Type 2185 [Type] -> Type
2477testdata/Prelude.lc 127:19-127:45 2186testdata/Prelude.lc 127:19-127:45
@@ -2548,9 +2257,6 @@ testdata/Prelude.lc 133:10-133:37
2548 HList (_b : _a) -> HList _a 2257 HList (_b : _a) -> HList _a
2549testdata/Prelude.lc 133:35-133:36 2258testdata/Prelude.lc 133:35-133:36
2550 HList _d 2259 HList _d
2551testdata/Prelude.lc 136:12-138:186
2552 forall a (b :: [RecItem])
2553 . forall (c :: String) -> isKeyC c a b => RecordC b -> a
2554testdata/Prelude.lc 136:28-136:37 2260testdata/Prelude.lc 136:28-136:37
2555 Type 2261 Type
2556testdata/Prelude.lc 136:28-136:97 2262testdata/Prelude.lc 136:28-136:97
@@ -2613,9 +2319,9 @@ testdata/Prelude.lc 137:75-137:87
2613testdata/Prelude.lc 137:75-137:90 2319testdata/Prelude.lc 137:75-137:90
2614 forall a . _a -> a 2320 forall a . _a -> a
2615testdata/Prelude.lc 137:75-137:125 2321testdata/Prelude.lc 137:75-137:125
2616 _a -> HList (_q : map RecItem Type recItemType _j) 2322 _a -> HList (_q : map recItemType _j)
2617testdata/Prelude.lc 137:75-137:128 2323testdata/Prelude.lc 137:75-137:128
2618 HList (_n : map RecItem Type recItemType _g) 2324 HList (_n : map recItemType _g)
2619testdata/Prelude.lc 137:93-137:98 2325testdata/Prelude.lc 137:93-137:98
2620 [Type] -> Type 2326 [Type] -> Type
2621testdata/Prelude.lc 137:93-137:124 2327testdata/Prelude.lc 137:93-137:124
@@ -2639,7 +2345,7 @@ testdata/Prelude.lc 137:109-137:120
2639testdata/Prelude.lc 137:121-137:123 2345testdata/Prelude.lc 137:121-137:123
2640 [RecItem] 2346 [RecItem]
2641testdata/Prelude.lc 137:126-137:128 2347testdata/Prelude.lc 137:126-137:128
2642 HList (map RecItem Type recItemType _d) 2348 HList (map recItemType _d)
2643testdata/Prelude.lc 138:57-138:64 2349testdata/Prelude.lc 138:57-138:64
2644 forall a (b :: [RecItem]) 2350 forall a (b :: [RecItem])
2645 . forall (c :: String) -> isKeyC c a b => RecordC b -> a 2351 . forall (c :: String) -> isKeyC c a b => RecordC b -> a
@@ -2683,21 +2389,21 @@ testdata/Prelude.lc 138:101-138:102
2683testdata/Prelude.lc 138:103-138:105 2389testdata/Prelude.lc 138:103-138:105
2684 [RecItem] 2390 [RecItem]
2685testdata/Prelude.lc 138:110-138:120 2391testdata/Prelude.lc 138:110-138:120
2686 forall (a :: [RecItem]) . HList (map RecItem Type recItemType a) -> RecordC a 2392 forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a
2687testdata/Prelude.lc 138:110-138:185 2393testdata/Prelude.lc 138:110-138:185
2688 RecordC _b 2394 RecordC _b
2689testdata/Prelude.lc 138:122-138:128 2395testdata/Prelude.lc 138:122-138:128
2690 forall a (b :: [Type]) . HList (a : b) -> HList b 2396 forall a (b :: [Type]) . HList (a : b) -> HList b
2691testdata/Prelude.lc 138:122-138:184 2397testdata/Prelude.lc 138:122-138:184
2692 HList (map RecItem Type recItemType _h) 2398 HList (map recItemType _h)
2693testdata/Prelude.lc 138:130-138:142 2399testdata/Prelude.lc 138:130-138:142
2694 forall a b . a -> b 2400 forall a b . a -> b
2695testdata/Prelude.lc 138:130-138:145 2401testdata/Prelude.lc 138:130-138:145
2696 forall a . _a -> a 2402 forall a . _a -> a
2697testdata/Prelude.lc 138:130-138:180 2403testdata/Prelude.lc 138:130-138:180
2698 _a -> HList (_r : map RecItem Type recItemType _k) 2404 _a -> HList (_r : map recItemType _k)
2699testdata/Prelude.lc 138:130-138:183 2405testdata/Prelude.lc 138:130-138:183
2700 HList (_o : map RecItem Type recItemType _h) 2406 HList (_o : map recItemType _h)
2701testdata/Prelude.lc 138:148-138:153 2407testdata/Prelude.lc 138:148-138:153
2702 [Type] -> Type 2408 [Type] -> Type
2703testdata/Prelude.lc 138:148-138:179 2409testdata/Prelude.lc 138:148-138:179
@@ -2721,7 +2427,7 @@ testdata/Prelude.lc 138:164-138:175
2721testdata/Prelude.lc 138:176-138:178 2427testdata/Prelude.lc 138:176-138:178
2722 [RecItem] 2428 [RecItem]
2723testdata/Prelude.lc 138:181-138:183 2429testdata/Prelude.lc 138:181-138:183
2724 HList (map RecItem Type recItemType _e) 2430 HList (map recItemType _e)
2725testdata/Prelude.lc 142:1-142:4 2431testdata/Prelude.lc 142:1-142:4
2726 Float -> Float -> Float -> VecS Float 4 2432 Float -> Float -> Float -> VecS Float 4
2727testdata/Prelude.lc 142:13-142:15 2433testdata/Prelude.lc 142:13-142:15
@@ -4674,8 +4380,6 @@ testdata/Prelude.lc 380:26-380:29
4674 Float 4380 Float
4675testdata/Prelude.lc 382:11-382:16 4381testdata/Prelude.lc 382:11-382:16
4676 Type 4382 Type
4677testdata/Prelude.lc 382:11-385:38
4678 Float -> Float -> [Float]
4679testdata/Prelude.lc 382:20-382:25 4383testdata/Prelude.lc 382:20-382:25
4680 Type 4384 Type
4681testdata/Prelude.lc 382:20-382:36 4385testdata/Prelude.lc 382:20-382:36
@@ -4733,8 +4437,6 @@ testdata/Prelude.lc 387:9-387:12
4733 Type 4437 Type
4734testdata/Prelude.lc 387:9-387:24 4438testdata/Prelude.lc 387:9-387:24
4735 Type 4439 Type
4736testdata/Prelude.lc 387:9-389:30
4737 forall a . [a] -> Int -> a
4738testdata/Prelude.lc 387:10-387:11 4440testdata/Prelude.lc 387:10-387:11
4739 _b 4441 _b
4740testdata/Prelude.lc 387:16-387:19 4442testdata/Prelude.lc 387:16-387:19