diff options
Diffstat (limited to 'testdata/Prelude.out')
-rw-r--r-- | testdata/Prelude.out | 196 |
1 files changed, 195 insertions, 1 deletions
diff --git a/testdata/Prelude.out b/testdata/Prelude.out index 3e8b2b17..e1b26503 100644 --- a/testdata/Prelude.out +++ b/testdata/Prelude.out | |||
@@ -1,15 +1,27 @@ | |||
1 | main is not found | ||
1 | ------------ desugared source code | 2 | ------------ desugared source code |
2 | infixr 9 . | 3 | infixr 9 . |
4 | |||
3 | infixl 7 PrimMulMatVec | 5 | infixl 7 PrimMulMatVec |
6 | |||
4 | infixl 7 PrimDot | 7 | infixl 7 PrimDot |
8 | |||
5 | infixr 5 ++ | 9 | infixr 5 ++ |
10 | |||
6 | infixr 3 *** | 11 | infixr 3 *** |
12 | |||
7 | infixr 0 $ | 13 | infixr 0 $ |
14 | |||
8 | const = \(a :: _) _ -> _rhs a | 15 | const = \(a :: _) _ -> _rhs a |
16 | |||
9 | otherwise = _rhs True | 17 | otherwise = _rhs True |
18 | |||
10 | (&) = \(a :: _) (b :: _) -> _rhs (b a) | 19 | (&) = \(a :: _) (b :: _) -> _rhs (b a) |
20 | |||
11 | ($) = _rhs \(a :: _) (b :: _) -> a b | 21 | ($) = _rhs \(a :: _) (b :: _) -> a b |
22 | |||
12 | (.) = _rhs \(a :: _) (b :: _) (c :: _) -> a (b c) | 23 | (.) = _rhs \(a :: _) (b :: _) (c :: _) -> a (b c) |
24 | |||
13 | uncurry | 25 | uncurry |
14 | = \(a :: _) (b :: _) -> hlistConsCase | 26 | = \(a :: _) (b :: _) -> hlistConsCase |
15 | _ | 27 | _ |
@@ -18,6 +30,7 @@ uncurry | |||
18 | (\(e :: _) (f :: _) -> hlistNilCase _ (_rhs (a c e)) f) | 30 | (\(e :: _) (f :: _) -> hlistNilCase _ (_rhs (a c e)) f) |
19 | d) | 31 | d) |
20 | b | 32 | b |
33 | |||
21 | (***) | 34 | (***) |
22 | = \(a :: _) (b :: _) (c :: _) -> hlistConsCase | 35 | = \(a :: _) (b :: _) (c :: _) -> hlistConsCase |
23 | _ | 36 | _ |
@@ -26,7 +39,9 @@ uncurry | |||
26 | (\(f :: _) (g :: _) -> hlistNilCase _ (_rhs (HCons (a d) (HCons (b f) HNil))) g) | 39 | (\(f :: _) (g :: _) -> hlistNilCase _ (_rhs (HCons (a d) (HCons (b f) HNil))) g) |
27 | e) | 40 | e) |
28 | c | 41 | c |
42 | |||
29 | pi = _rhs 3.141592653589793 | 43 | pi = _rhs 3.141592653589793 |
44 | |||
30 | zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [HList (a : b : '[])] | 45 | zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [HList (a : b : '[])] |
31 | zip | 46 | zip |
32 | = \(a :: _) (b :: _) -> case'List | 47 | = \(a :: _) (b :: _) -> case'List |
@@ -38,6 +53,7 @@ zip | |||
38 | (\(e :: _) (f :: _) -> _rhs (HCons c (HCons e HNil) : zip d f)) | 53 | (\(e :: _) (f :: _) -> _rhs (HCons c (HCons e HNil) : zip d f)) |
39 | b) | 54 | b) |
40 | a | 55 | a |
56 | |||
41 | unzip | 57 | unzip |
42 | :: forall (a :: _) (b :: _) . [HList (a : b : '[])] -> HList ([a] : [b] : '[]) | 58 | :: forall (a :: _) (b :: _) . [HList (a : b : '[])] -> HList ([a] : [b] : '[]) |
43 | unzip | 59 | unzip |
@@ -70,6 +86,7 @@ unzip | |||
70 | e) | 86 | e) |
71 | b) | 87 | b) |
72 | a | 88 | a |
89 | |||
73 | filter | 90 | filter |
74 | = \(a :: _) (b :: _) -> case'List | 91 | = \(a :: _) (b :: _) -> case'List |
75 | (\_ -> _) | 92 | (\_ -> _) |
@@ -77,23 +94,28 @@ filter | |||
77 | (\(c :: _) (d :: _) -> _rhs | 94 | (\(c :: _) (d :: _) -> _rhs |
78 | ((\(e :: _) -> case'Bool (\_ -> _) (filter a d) (c : filter a d) e) (a c))) | 95 | ((\(e :: _) -> case'Bool (\_ -> _) (filter a d) (c : filter a d) e) (a c))) |
79 | b | 96 | b |
97 | |||
80 | tail :: forall (a :: _) . [a] -> [a] | 98 | tail :: forall (a :: _) . [a] -> [a] |
81 | tail | 99 | tail |
82 | = \(a :: _) -> case'List (\_ -> _) (_rhs undefined) (\_ (b :: _) -> _rhs b) a | 100 | = \(a :: _) -> case'List (\_ -> _) (_rhs undefined) (\_ (b :: _) -> _rhs b) a |
101 | |||
83 | pairs :: forall (a :: _) . [a] -> [HList (a : a : '[])] | 102 | pairs :: forall (a :: _) . [a] -> [HList (a : a : '[])] |
84 | pairs = \(a :: _) -> _rhs (zip a (tail a)) | 103 | pairs = \(a :: _) -> _rhs (zip a (tail a)) |
104 | |||
85 | foldl' | 105 | foldl' |
86 | = \(a :: _) (b :: _) (c :: _) -> case'List | 106 | = \(a :: _) (b :: _) (c :: _) -> case'List |
87 | (\_ -> _) | 107 | (\_ -> _) |
88 | (_rhs b) | 108 | (_rhs b) |
89 | (\(d :: _) (e :: _) -> _rhs (foldl' a (a b d) e)) | 109 | (\(d :: _) (e :: _) -> _rhs (foldl' a (a b d) e)) |
90 | c | 110 | c |
111 | |||
91 | foldr1 | 112 | foldr1 |
92 | = \(a :: _) (b :: _) -> case'List | 113 | = \(a :: _) (b :: _) -> case'List |
93 | (\_ -> _) | 114 | (\_ -> _) |
94 | (_rhs undefined) | 115 | (_rhs undefined) |
95 | (\(c :: _) (d :: _) -> _rhs (foldr a c d)) | 116 | (\(c :: _) (d :: _) -> _rhs (foldr a c d)) |
96 | b | 117 | b |
118 | |||
97 | split | 119 | split |
98 | = \(a :: _) -> case'List | 120 | = \(a :: _) -> case'List |
99 | (\_ -> _) | 121 | (\_ -> _) |
@@ -115,6 +137,7 @@ split | |||
115 | k) | 137 | k) |
116 | d)) -> HCons (b : e) (HCons f HNil)) | 138 | d)) -> HCons (b : e) (HCons f HNil)) |
117 | a | 139 | a |
140 | |||
118 | mergeBy | 141 | mergeBy |
119 | = \(a :: _) (b :: _) (c :: _) -> case'List | 142 | = \(a :: _) (b :: _) (c :: _) -> case'List |
120 | (\_ -> _) | 143 | (\_ -> _) |
@@ -132,6 +155,7 @@ mergeBy | |||
132 | (a d f))) | 155 | (a d f))) |
133 | c) | 156 | c) |
134 | b | 157 | b |
158 | |||
135 | sortBy | 159 | sortBy |
136 | = \(a :: _) (b :: _) -> case'List | 160 | = \(a :: _) (b :: _) -> case'List |
137 | (\_ -> _) | 161 | (\_ -> _) |
@@ -142,8 +166,10 @@ sortBy | |||
142 | (\_ _ -> _rhs (uncurry (mergeBy a) ((sortBy a *** sortBy a) (split b)))) | 166 | (\_ _ -> _rhs (uncurry (mergeBy a) ((sortBy a *** sortBy a) (split b)))) |
143 | d) | 167 | d) |
144 | b | 168 | b |
169 | |||
145 | iterate :: forall (a :: _) . (a -> a) -> a -> [a] | 170 | iterate :: forall (a :: _) . (a -> a) -> a -> [a] |
146 | iterate = \(a :: _) (b :: _) -> _rhs (b : iterate a (a b)) | 171 | iterate = \(a :: _) (b :: _) -> _rhs (b : iterate a (a b)) |
172 | |||
147 | fst | 173 | fst |
148 | = \(a :: _) -> hlistConsCase | 174 | = \(a :: _) -> hlistConsCase |
149 | _ | 175 | _ |
@@ -152,6 +178,7 @@ fst | |||
152 | (\_ (d :: _) -> hlistNilCase _ (_rhs b) d) | 178 | (\_ (d :: _) -> hlistNilCase _ (_rhs b) d) |
153 | c) | 179 | c) |
154 | a | 180 | a |
181 | |||
155 | snd | 182 | snd |
156 | = \(a :: _) -> hlistConsCase | 183 | = \(a :: _) -> hlistConsCase |
157 | _ | 184 | _ |
@@ -160,15 +187,23 @@ snd | |||
160 | (\(c :: _) (d :: _) -> hlistNilCase _ (_rhs c) d) | 187 | (\(c :: _) (d :: _) -> hlistNilCase _ (_rhs c) d) |
161 | b) | 188 | b) |
162 | a | 189 | a |
190 | |||
163 | (|||) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs b) (_rhs True) a | 191 | (|||) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs b) (_rhs True) a |
192 | |||
164 | infixr 2 ||| | 193 | infixr 2 ||| |
194 | |||
165 | (&&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs False) (_rhs b) a | 195 | (&&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs False) (_rhs b) a |
196 | |||
166 | infixr 3 &&& | 197 | infixr 3 &&& |
198 | |||
167 | data RecItem :: Type where | 199 | data RecItem :: Type where |
168 | RecItem :: String -> Type -> RecItem | 200 | RecItem :: String -> Type -> RecItem |
201 | |||
169 | recItemType = \(a :: _) -> case'RecItem (\_ -> _) (\_ (b :: _) -> _rhs b) a | 202 | recItemType = \(a :: _) -> case'RecItem (\_ -> _) (\_ (b :: _) -> _rhs b) a |
203 | |||
170 | data RecordC (_ :: [RecItem]) :: Type where | 204 | data RecordC (_ :: [RecItem]) :: Type where |
171 | RecordCons :: forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a | 205 | RecordCons :: forall (a :: [RecItem]) . HList (map recItemType a) -> RecordC a |
206 | |||
172 | isKeyC | 207 | isKeyC |
173 | = \(a :: _) (b :: _) (c :: _) -> case'List | 208 | = \(a :: _) (b :: _) (c :: _) -> case'List |
174 | (\_ -> _) | 209 | (\_ -> _) |
@@ -179,8 +214,11 @@ isKeyC | |||
179 | (primIfThenElse (a == f) (b `'EqCTt` g) (isKeyC a b e))) | 214 | (primIfThenElse (a == f) (b `'EqCTt` g) (isKeyC a b e))) |
180 | d) | 215 | d) |
181 | c | 216 | c |
217 | |||
182 | fstTup = _rhs (hlistConsCase (_ :: _) \(a :: _) _ -> a) | 218 | fstTup = _rhs (hlistConsCase (_ :: _) \(a :: _) _ -> a) |
219 | |||
183 | sndTup = _rhs (hlistConsCase (_ :: _) \_ (a :: _) -> a) | 220 | sndTup = _rhs (hlistConsCase (_ :: _) \_ (a :: _) -> a) |
221 | |||
184 | project | 222 | project |
185 | :: forall (a :: _) (b :: [RecItem]) | 223 | :: forall (a :: _) (b :: [RecItem]) |
186 | . forall (c :: String) -> isKeyC c a b => RecordC b -> a | 224 | . forall (c :: String) -> isKeyC c a b => RecordC b -> a |
@@ -207,156 +245,304 @@ project | |||
207 | d) | 245 | d) |
208 | e) | 246 | e) |
209 | b | 247 | b |
248 | |||
210 | rgb = \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0) | 249 | rgb = \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0) |
250 | |||
211 | black = _rhs (rgb 0.0 0.0 0.0) | 251 | black = _rhs (rgb 0.0 0.0 0.0) |
252 | |||
212 | gray = _rhs (rgb 0.5 0.5 0.5) | 253 | gray = _rhs (rgb 0.5 0.5 0.5) |
254 | |||
213 | silver = _rhs (rgb 0.75 0.75 0.75) | 255 | silver = _rhs (rgb 0.75 0.75 0.75) |
256 | |||
214 | white = _rhs (rgb 1.0 1.0 1.0) | 257 | white = _rhs (rgb 1.0 1.0 1.0) |
258 | |||
215 | maroon = _rhs (rgb 0.5 0.0 0.0) | 259 | maroon = _rhs (rgb 0.5 0.0 0.0) |
260 | |||
216 | red = _rhs (rgb 1.0 0.0 0.0) | 261 | red = _rhs (rgb 1.0 0.0 0.0) |
262 | |||
217 | olive = _rhs (rgb 0.5 0.5 0.0) | 263 | olive = _rhs (rgb 0.5 0.5 0.0) |
264 | |||
218 | yellow = _rhs (rgb 1.0 1.0 0.0) | 265 | yellow = _rhs (rgb 1.0 1.0 0.0) |
266 | |||
219 | green = _rhs (rgb 0.0 0.5 0.0) | 267 | green = _rhs (rgb 0.0 0.5 0.0) |
268 | |||
220 | lime = _rhs (rgb 0.0 1.0 0.0) | 269 | lime = _rhs (rgb 0.0 1.0 0.0) |
270 | |||
221 | teal = _rhs (rgb 0.0 0.5 0.5) | 271 | teal = _rhs (rgb 0.0 0.5 0.5) |
272 | |||
222 | aqua = _rhs (rgb 0.0 1.0 1.0) | 273 | aqua = _rhs (rgb 0.0 1.0 1.0) |
274 | |||
223 | navy = _rhs (rgb 0.0 0.0 0.5) | 275 | navy = _rhs (rgb 0.0 0.0 0.5) |
276 | |||
224 | blue = _rhs (rgb 0.0 0.0 1.0) | 277 | blue = _rhs (rgb 0.0 0.0 1.0) |
278 | |||
225 | purple = _rhs (rgb 0.5 0.0 0.5) | 279 | purple = _rhs (rgb 0.5 0.0 0.5) |
280 | |||
226 | fuchsia = _rhs (rgb 1.0 0.0 1.0) | 281 | fuchsia = _rhs (rgb 1.0 0.0 1.0) |
282 | |||
227 | colorImage1 = _rhs (ColorImage @(fromInt 1)) | 283 | colorImage1 = _rhs (ColorImage @(fromInt 1)) |
284 | |||
228 | colorImage2 = _rhs (ColorImage @(fromInt 2)) | 285 | colorImage2 = _rhs (ColorImage @(fromInt 2)) |
286 | |||
229 | depthImage1 = _rhs (DepthImage @(fromInt 1)) | 287 | depthImage1 = _rhs (DepthImage @(fromInt 1)) |
288 | |||
230 | v3FToV4F :: Vec (fromInt 3) Float -> Vec (fromInt 4) Float | 289 | v3FToV4F :: Vec (fromInt 3) Float -> Vec (fromInt 4) Float |
231 | v3FToV4F | 290 | v3FToV4F |
232 | = \(a :: _) -> _rhs | 291 | = \(a :: _) -> _rhs |
233 | (V4 (swizzscalar a Sx) (swizzscalar a Sy) (swizzscalar a Sz) (fromInt 1)) | 292 | (V4 (swizzscalar a Sx) (swizzscalar a Sy) (swizzscalar a Sz) (fromInt 1)) |
293 | |||
234 | radians = _rhs PrimRadians | 294 | radians = _rhs PrimRadians |
295 | |||
235 | degrees = _rhs PrimDegrees | 296 | degrees = _rhs PrimDegrees |
297 | |||
236 | sin = _rhs PrimSin | 298 | sin = _rhs PrimSin |
299 | |||
237 | cos = _rhs PrimCos | 300 | cos = _rhs PrimCos |
301 | |||
238 | tan = _rhs PrimTan | 302 | tan = _rhs PrimTan |
303 | |||
239 | sinh = _rhs PrimSinH | 304 | sinh = _rhs PrimSinH |
305 | |||
240 | cosh = _rhs PrimCosH | 306 | cosh = _rhs PrimCosH |
307 | |||
241 | tanh = _rhs PrimTanH | 308 | tanh = _rhs PrimTanH |
309 | |||
242 | asin = _rhs PrimASin | 310 | asin = _rhs PrimASin |
311 | |||
243 | asinh = _rhs PrimASinH | 312 | asinh = _rhs PrimASinH |
313 | |||
244 | acos = _rhs PrimACos | 314 | acos = _rhs PrimACos |
315 | |||
245 | acosh = _rhs PrimACosH | 316 | acosh = _rhs PrimACosH |
317 | |||
246 | atan = _rhs PrimATan | 318 | atan = _rhs PrimATan |
319 | |||
247 | atanh = _rhs PrimATanH | 320 | atanh = _rhs PrimATanH |
321 | |||
248 | atan2 = _rhs PrimATan2 | 322 | atan2 = _rhs PrimATan2 |
323 | |||
249 | pow = _rhs PrimPow | 324 | pow = _rhs PrimPow |
325 | |||
250 | exp = _rhs PrimExp | 326 | exp = _rhs PrimExp |
327 | |||
251 | log = _rhs PrimLog | 328 | log = _rhs PrimLog |
329 | |||
252 | exp2 = _rhs PrimExp2 | 330 | exp2 = _rhs PrimExp2 |
331 | |||
253 | log2 = _rhs PrimLog2 | 332 | log2 = _rhs PrimLog2 |
333 | |||
254 | sqrt = _rhs PrimSqrt | 334 | sqrt = _rhs PrimSqrt |
335 | |||
255 | inversesqrt = _rhs PrimInvSqrt | 336 | inversesqrt = _rhs PrimInvSqrt |
337 | |||
256 | abs = _rhs PrimAbs | 338 | abs = _rhs PrimAbs |
339 | |||
257 | sign = _rhs PrimSign | 340 | sign = _rhs PrimSign |
341 | |||
258 | floor = _rhs PrimFloor | 342 | floor = _rhs PrimFloor |
343 | |||
259 | trunc = _rhs PrimTrunc | 344 | trunc = _rhs PrimTrunc |
345 | |||
260 | round = _rhs PrimRound | 346 | round = _rhs PrimRound |
347 | |||
261 | roundEven = _rhs PrimRoundEven | 348 | roundEven = _rhs PrimRoundEven |
349 | |||
262 | ceil = _rhs PrimCeil | 350 | ceil = _rhs PrimCeil |
351 | |||
263 | fract = _rhs PrimFract | 352 | fract = _rhs PrimFract |
353 | |||
264 | mod = _rhs PrimMod | 354 | mod = _rhs PrimMod |
355 | |||
265 | min = _rhs PrimMin | 356 | min = _rhs PrimMin |
357 | |||
266 | max = _rhs PrimMax | 358 | max = _rhs PrimMax |
359 | |||
267 | modF = _rhs PrimModF | 360 | modF = _rhs PrimModF |
361 | |||
268 | clamp = _rhs PrimClamp | 362 | clamp = _rhs PrimClamp |
363 | |||
269 | clampS = _rhs PrimClampS | 364 | clampS = _rhs PrimClampS |
365 | |||
270 | mix = _rhs PrimMix | 366 | mix = _rhs PrimMix |
367 | |||
271 | mixS = _rhs PrimMixS | 368 | mixS = _rhs PrimMixS |
369 | |||
272 | mixB = _rhs PrimMixB | 370 | mixB = _rhs PrimMixB |
371 | |||
273 | step = _rhs PrimStep | 372 | step = _rhs PrimStep |
373 | |||
274 | stepS = _rhs PrimStepS | 374 | stepS = _rhs PrimStepS |
375 | |||
275 | smoothstep = _rhs PrimSmoothStep | 376 | smoothstep = _rhs PrimSmoothStep |
377 | |||
276 | smoothstepS = _rhs PrimSmoothStepS | 378 | smoothstepS = _rhs PrimSmoothStepS |
379 | |||
277 | isNan = _rhs PrimIsNan | 380 | isNan = _rhs PrimIsNan |
381 | |||
278 | isInf = _rhs PrimIsInf | 382 | isInf = _rhs PrimIsInf |
383 | |||
279 | dFdx = _rhs PrimDFdx | 384 | dFdx = _rhs PrimDFdx |
385 | |||
280 | dFdy = _rhs PrimDFdy | 386 | dFdy = _rhs PrimDFdy |
387 | |||
281 | fWidth = _rhs PrimFWidth | 388 | fWidth = _rhs PrimFWidth |
389 | |||
282 | noise1 = _rhs PrimNoise1 | 390 | noise1 = _rhs PrimNoise1 |
391 | |||
283 | noise2 = _rhs PrimNoise2 | 392 | noise2 = _rhs PrimNoise2 |
393 | |||
284 | noise3 = _rhs PrimNoise3 | 394 | noise3 = _rhs PrimNoise3 |
395 | |||
285 | noise4 = _rhs PrimNoise4 | 396 | noise4 = _rhs PrimNoise4 |
397 | |||
286 | length = _rhs PrimLength | 398 | length = _rhs PrimLength |
399 | |||
287 | distance = _rhs PrimDistance | 400 | distance = _rhs PrimDistance |
401 | |||
288 | dot = _rhs PrimDot | 402 | dot = _rhs PrimDot |
403 | |||
289 | cross = _rhs PrimCross | 404 | cross = _rhs PrimCross |
405 | |||
290 | normalize = _rhs PrimNormalize | 406 | normalize = _rhs PrimNormalize |
407 | |||
291 | faceforward = _rhs PrimFaceForward | 408 | faceforward = _rhs PrimFaceForward |
409 | |||
292 | reflect = _rhs PrimReflect | 410 | reflect = _rhs PrimReflect |
411 | |||
293 | refract = _rhs PrimRefract | 412 | refract = _rhs PrimRefract |
413 | |||
294 | transpose = _rhs PrimTranspose | 414 | transpose = _rhs PrimTranspose |
415 | |||
295 | det = _rhs PrimDeterminant | 416 | det = _rhs PrimDeterminant |
417 | |||
296 | inv = _rhs PrimInverse | 418 | inv = _rhs PrimInverse |
419 | |||
297 | outer = _rhs PrimOuterProduct | 420 | outer = _rhs PrimOuterProduct |
421 | |||
298 | bAnd = _rhs PrimBAnd | 422 | bAnd = _rhs PrimBAnd |
423 | |||
299 | bOr = _rhs PrimBOr | 424 | bOr = _rhs PrimBOr |
425 | |||
300 | bXor = _rhs PrimBXor | 426 | bXor = _rhs PrimBXor |
427 | |||
301 | bNot = _rhs PrimBNot | 428 | bNot = _rhs PrimBNot |
429 | |||
302 | bAndS = _rhs PrimBAndS | 430 | bAndS = _rhs PrimBAndS |
431 | |||
303 | bOrS = _rhs PrimBOrS | 432 | bOrS = _rhs PrimBOrS |
433 | |||
304 | bXorS = _rhs PrimBXorS | 434 | bXorS = _rhs PrimBXorS |
435 | |||
305 | shiftL = _rhs PrimBShiftL | 436 | shiftL = _rhs PrimBShiftL |
437 | |||
306 | shiftR = _rhs PrimBShiftR | 438 | shiftR = _rhs PrimBShiftR |
439 | |||
307 | shiftLS = _rhs PrimBShiftLS | 440 | shiftLS = _rhs PrimBShiftLS |
441 | |||
308 | shiftRS = _rhs PrimBShiftRS | 442 | shiftRS = _rhs PrimBShiftRS |
443 | |||
309 | floatBitsToInt = _rhs PrimFloatBitsToInt | 444 | floatBitsToInt = _rhs PrimFloatBitsToInt |
445 | |||
310 | floatBitsToWord = _rhs PrimFloatBitsToUInt | 446 | floatBitsToWord = _rhs PrimFloatBitsToUInt |
447 | |||
311 | intBitsToFloat = _rhs PrimIntBitsToFloat | 448 | intBitsToFloat = _rhs PrimIntBitsToFloat |
449 | |||
312 | wordBitsToFloat = _rhs PrimUIntBitsToFloat | 450 | wordBitsToFloat = _rhs PrimUIntBitsToFloat |
451 | |||
313 | infixl 7 * | 452 | infixl 7 * |
453 | |||
314 | infixl 7 / | 454 | infixl 7 / |
455 | |||
315 | infixl 7 % | 456 | infixl 7 % |
457 | |||
316 | infixl 6 + | 458 | infixl 6 + |
459 | |||
317 | infixl 6 - | 460 | infixl 6 - |
461 | |||
318 | infix 4 /= | 462 | infix 4 /= |
463 | |||
319 | infix 4 < | 464 | infix 4 < |
465 | |||
320 | infix 4 <= | 466 | infix 4 <= |
467 | |||
321 | infix 4 >= | 468 | infix 4 >= |
469 | |||
322 | infix 4 > | 470 | infix 4 > |
471 | |||
323 | infixr 3 && | 472 | infixr 3 && |
473 | |||
324 | infixr 2 || | 474 | infixr 2 || |
475 | |||
325 | infix 7 dot | 476 | infix 7 dot |
477 | |||
326 | infix 7 cross | 478 | infix 7 cross |
479 | |||
327 | infixr 7 *. | 480 | infixr 7 *. |
481 | |||
328 | infixl 7 .* | 482 | infixl 7 .* |
483 | |||
329 | infixl 7 .*. | 484 | infixl 7 .*. |
485 | |||
330 | (+) = \(a :: _) (b :: _) -> _rhs (PrimAdd a b) | 486 | (+) = \(a :: _) (b :: _) -> _rhs (PrimAdd a b) |
487 | |||
331 | (-) = \(a :: _) (b :: _) -> _rhs (PrimSub a b) | 488 | (-) = \(a :: _) (b :: _) -> _rhs (PrimSub a b) |
489 | |||
332 | (*) = \(a :: _) (b :: _) -> _rhs (PrimMul a b) | 490 | (*) = \(a :: _) (b :: _) -> _rhs (PrimMul a b) |
491 | |||
333 | (/) = \(a :: _) (b :: _) -> _rhs (PrimDiv a b) | 492 | (/) = \(a :: _) (b :: _) -> _rhs (PrimDiv a b) |
493 | |||
334 | (%) = \(a :: _) (b :: _) -> _rhs (PrimMod a b) | 494 | (%) = \(a :: _) (b :: _) -> _rhs (PrimMod a b) |
495 | |||
335 | neg = \(a :: _) -> _rhs (PrimNeg a) | 496 | neg = \(a :: _) -> _rhs (PrimNeg a) |
497 | |||
336 | (/=) = \(a :: _) (b :: _) -> _rhs (PrimNotEqual a b) | 498 | (/=) = \(a :: _) (b :: _) -> _rhs (PrimNotEqual a b) |
499 | |||
337 | (<) = \(a :: _) (b :: _) -> _rhs (PrimLessThan a b) | 500 | (<) = \(a :: _) (b :: _) -> _rhs (PrimLessThan a b) |
501 | |||
338 | (<=) = \(a :: _) (b :: _) -> _rhs (PrimLessThanEqual a b) | 502 | (<=) = \(a :: _) (b :: _) -> _rhs (PrimLessThanEqual a b) |
503 | |||
339 | (>=) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThanEqual a b) | 504 | (>=) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThanEqual a b) |
505 | |||
340 | (>) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThan a b) | 506 | (>) = \(a :: _) (b :: _) -> _rhs (PrimGreaterThan a b) |
507 | |||
341 | (&&) = \(a :: _) (b :: _) -> _rhs (PrimAnd a b) | 508 | (&&) = \(a :: _) (b :: _) -> _rhs (PrimAnd a b) |
509 | |||
342 | (||) = \(a :: _) (b :: _) -> _rhs (PrimOr a b) | 510 | (||) = \(a :: _) (b :: _) -> _rhs (PrimOr a b) |
511 | |||
343 | xor = _rhs PrimXor | 512 | xor = _rhs PrimXor |
513 | |||
344 | not = \(a :: _) -> _rhs (PrimNot a) | 514 | not = \(a :: _) -> _rhs (PrimNot a) |
515 | |||
345 | any = \(a :: _) -> _rhs (PrimAny a) | 516 | any = \(a :: _) -> _rhs (PrimAny a) |
517 | |||
346 | all = \(a :: _) -> _rhs (PrimAll a) | 518 | all = \(a :: _) -> _rhs (PrimAll a) |
519 | |||
347 | (.*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatMat a b) | 520 | (.*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatMat a b) |
521 | |||
348 | (*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatVec a b) | 522 | (*.) = \(a :: _) (b :: _) -> _rhs (PrimMulMatVec a b) |
523 | |||
349 | (.*) = \(a :: _) (b :: _) -> _rhs (PrimMulVecMat a b) | 524 | (.*) = \(a :: _) (b :: _) -> _rhs (PrimMulVecMat a b) |
525 | |||
350 | infixl 7 *! | 526 | infixl 7 *! |
527 | |||
351 | infixl 7 /! | 528 | infixl 7 /! |
529 | |||
352 | infixl 7 %! | 530 | infixl 7 %! |
531 | |||
353 | infixl 6 +! | 532 | infixl 6 +! |
533 | |||
354 | infixl 6 -! | 534 | infixl 6 -! |
535 | |||
355 | (+!) = \(a :: _) (b :: _) -> _rhs (PrimAddS a b) | 536 | (+!) = \(a :: _) (b :: _) -> _rhs (PrimAddS a b) |
537 | |||
356 | (-!) = \(a :: _) (b :: _) -> _rhs (PrimSubS a b) | 538 | (-!) = \(a :: _) (b :: _) -> _rhs (PrimSubS a b) |
539 | |||
357 | (*!) = \(a :: _) (b :: _) -> _rhs (PrimMulS a b) | 540 | (*!) = \(a :: _) (b :: _) -> _rhs (PrimMulS a b) |
541 | |||
358 | (/!) = \(a :: _) (b :: _) -> _rhs (PrimDivS a b) | 542 | (/!) = \(a :: _) (b :: _) -> _rhs (PrimDivS a b) |
543 | |||
359 | (%!) = \(a :: _) (b :: _) -> _rhs (PrimModS a b) | 544 | (%!) = \(a :: _) (b :: _) -> _rhs (PrimModS a b) |
545 | |||
360 | perspective | 546 | perspective |
361 | :: Float -> Float -> Float -> Float -> Mat (fromInt 4) (fromInt 4) Float | 547 | :: Float -> Float -> Float -> Float -> Mat (fromInt 4) (fromInt 4) Float |
362 | perspective | 548 | perspective |
@@ -376,6 +562,7 @@ perspective | |||
376 | (fromInt 0) | 562 | (fromInt 0) |
377 | (fromInt 0 - fromInt 2 * b * a / (b - a)) | 563 | (fromInt 0 - fromInt 2 * b * a / (b - a)) |
378 | (fromInt 0)) | 564 | (fromInt 0)) |
565 | |||
379 | rotMatrixZ | 566 | rotMatrixZ |
380 | = \(a :: _) -> _rhs | 567 | = \(a :: _) -> _rhs |
381 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F | 568 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F |
@@ -383,6 +570,7 @@ rotMatrixZ | |||
383 | (V4 (fromInt 0 - c) b (fromInt 0) (fromInt 0)) | 570 | (V4 (fromInt 0 - c) b (fromInt 0) (fromInt 0)) |
384 | (V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0)) | 571 | (V4 (fromInt 0) (fromInt 0) (fromInt 1) (fromInt 0)) |
385 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) | 572 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) |
573 | |||
386 | rotMatrixY | 574 | rotMatrixY |
387 | = \(a :: _) -> _rhs | 575 | = \(a :: _) -> _rhs |
388 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F | 576 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F |
@@ -390,6 +578,7 @@ rotMatrixY | |||
390 | (V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0)) | 578 | (V4 (fromInt 0) (fromInt 1) (fromInt 0) (fromInt 0)) |
391 | (V4 c (fromInt 0) b (fromInt 0)) | 579 | (V4 c (fromInt 0) b (fromInt 0)) |
392 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) | 580 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) |
581 | |||
393 | rotMatrixX | 582 | rotMatrixX |
394 | = \(a :: _) -> _rhs | 583 | = \(a :: _) -> _rhs |
395 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F | 584 | \(b := _rhs (cos a)) (c := _rhs (sin a)) -> M44F |
@@ -397,9 +586,11 @@ rotMatrixX | |||
397 | (V4 (fromInt 0) b c (fromInt 0)) | 586 | (V4 (fromInt 0) b c (fromInt 0)) |
398 | (V4 (fromInt 0) (fromInt 0 - c) b (fromInt 0)) | 587 | (V4 (fromInt 0) (fromInt 0 - c) b (fromInt 0)) |
399 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) | 588 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)) |
589 | |||
400 | rotationEuler | 590 | rotationEuler |
401 | = \(a :: _) (b :: _) (c :: _) -> _rhs | 591 | = \(a :: _) (b :: _) (c :: _) -> _rhs |
402 | (rotMatrixY a .*. rotMatrixX b .*. rotMatrixZ c) | 592 | (rotMatrixY a .*. rotMatrixX b .*. rotMatrixZ c) |
593 | |||
403 | translateBefore4 :: Vec (fromInt 3) Float -> Mat (fromInt 4) (fromInt 4) Float | 594 | translateBefore4 :: Vec (fromInt 3) Float -> Mat (fromInt 4) (fromInt 4) Float |
404 | translateBefore4 | 595 | translateBefore4 |
405 | = \(a :: _) -> _rhs | 596 | = \(a :: _) -> _rhs |
@@ -413,6 +604,7 @@ translateBefore4 | |||
413 | (swizzscalar a Sy) | 604 | (swizzscalar a Sy) |
414 | (swizzscalar a Sz) | 605 | (swizzscalar a Sz) |
415 | (fromInt 1))) -> M44F b c d e | 606 | (fromInt 1))) -> M44F b c d e |
607 | |||
416 | lookat | 608 | lookat |
417 | :: Vec (fromInt 3) Float | 609 | :: Vec (fromInt 3) Float |
418 | -> Vec (fromInt 3) Float | 610 | -> Vec (fromInt 3) Float |
@@ -434,7 +626,9 @@ lookat | |||
434 | (d e) | 626 | (d e) |
435 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)))) -> h | 627 | (V4 (fromInt 0) (fromInt 0) (fromInt 0) (fromInt 1)))) -> h |
436 | .*. translateBefore4 (neg a) | 628 | .*. translateBefore4 (neg a) |
629 | |||
437 | scale = \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0) | 630 | scale = \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0) |
631 | |||
438 | fromTo :: Float -> Float -> [Float] | 632 | fromTo :: Float -> Float -> [Float] |
439 | fromTo | 633 | fromTo |
440 | = \(a :: _) (b :: _) -> case'Bool | 634 | = \(a :: _) (b :: _) -> case'Bool |
@@ -442,6 +636,7 @@ fromTo | |||
442 | (_rhs (a : fromTo (a + fromInt 1) b)) | 636 | (_rhs (a : fromTo (a + fromInt 1) b)) |
443 | (_rhs []) | 637 | (_rhs []) |
444 | (a > b) | 638 | (a > b) |
639 | |||
445 | (!!) :: forall (a :: _) . [a] -> Int -> a | 640 | (!!) :: forall (a :: _) . [a] -> Int -> a |
446 | (!!) | 641 | (!!) |
447 | = \(a :: _) (b :: _) -> case'List | 642 | = \(a :: _) (b :: _) -> case'List |
@@ -453,7 +648,6 @@ fromTo | |||
453 | (_rhs c) | 648 | (_rhs c) |
454 | (fromInt 0 == b)) | 649 | (fromInt 0 == b)) |
455 | a | 650 | a |
456 | main is not found | ||
457 | ------------ trace | 651 | ------------ trace |
458 | const :: forall a b . a -> b -> a | 652 | const :: forall a b . a -> b -> a |
459 | otherwise :: Bool | 653 | otherwise :: Bool |