summaryrefslogtreecommitdiff
path: root/testdata/Prelude.out
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/Prelude.out')
-rw-r--r--testdata/Prelude.out196
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 @@
1main is not found
1------------ desugared source code 2------------ desugared source code
2infixr 9 . 3infixr 9 .
4
3infixl 7 PrimMulMatVec 5infixl 7 PrimMulMatVec
6
4infixl 7 PrimDot 7infixl 7 PrimDot
8
5infixr 5 ++ 9infixr 5 ++
10
6infixr 3 *** 11infixr 3 ***
12
7infixr 0 $ 13infixr 0 $
14
8const = \(a :: _) _ -> _rhs a 15const = \(a :: _) _ -> _rhs a
16
9otherwise = _rhs True 17otherwise = _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
13uncurry 25uncurry
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
29pi = _rhs 3.141592653589793 43pi = _rhs 3.141592653589793
44
30zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [HList (a : b : '[])] 45zip :: forall (a :: _) (b :: _) . [a] -> [b] -> [HList (a : b : '[])]
31zip 46zip
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
41unzip 57unzip
42 :: forall (a :: _) (b :: _) . [HList (a : b : '[])] -> HList ([a] : [b] : '[]) 58 :: forall (a :: _) (b :: _) . [HList (a : b : '[])] -> HList ([a] : [b] : '[])
43unzip 59unzip
@@ -70,6 +86,7 @@ unzip
70 e) 86 e)
71 b) 87 b)
72 a 88 a
89
73filter 90filter
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
80tail :: forall (a :: _) . [a] -> [a] 98tail :: forall (a :: _) . [a] -> [a]
81tail 99tail
82 = \(a :: _) -> case'List (\_ -> _) (_rhs undefined) (\_ (b :: _) -> _rhs b) a 100 = \(a :: _) -> case'List (\_ -> _) (_rhs undefined) (\_ (b :: _) -> _rhs b) a
101
83pairs :: forall (a :: _) . [a] -> [HList (a : a : '[])] 102pairs :: forall (a :: _) . [a] -> [HList (a : a : '[])]
84pairs = \(a :: _) -> _rhs (zip a (tail a)) 103pairs = \(a :: _) -> _rhs (zip a (tail a))
104
85foldl' 105foldl'
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
91foldr1 112foldr1
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
97split 119split
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
118mergeBy 141mergeBy
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
135sortBy 159sortBy
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
145iterate :: forall (a :: _) . (a -> a) -> a -> [a] 170iterate :: forall (a :: _) . (a -> a) -> a -> [a]
146iterate = \(a :: _) (b :: _) -> _rhs (b : iterate a (a b)) 171iterate = \(a :: _) (b :: _) -> _rhs (b : iterate a (a b))
172
147fst 173fst
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
155snd 182snd
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
164infixr 2 ||| 193infixr 2 |||
194
165(&&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs False) (_rhs b) a 195(&&&) = \(a :: _) (b :: _) -> case'Bool (\_ -> _) (_rhs False) (_rhs b) a
196
166infixr 3 &&& 197infixr 3 &&&
198
167data RecItem :: Type where 199data RecItem :: Type where
168 RecItem :: String -> Type -> RecItem 200 RecItem :: String -> Type -> RecItem
201
169recItemType = \(a :: _) -> case'RecItem (\_ -> _) (\_ (b :: _) -> _rhs b) a 202recItemType = \(a :: _) -> case'RecItem (\_ -> _) (\_ (b :: _) -> _rhs b) a
203
170data RecordC (_ :: [RecItem]) :: Type where 204data 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
172isKeyC 207isKeyC
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
182fstTup = _rhs (hlistConsCase (_ :: _) \(a :: _) _ -> a) 218fstTup = _rhs (hlistConsCase (_ :: _) \(a :: _) _ -> a)
219
183sndTup = _rhs (hlistConsCase (_ :: _) \_ (a :: _) -> a) 220sndTup = _rhs (hlistConsCase (_ :: _) \_ (a :: _) -> a)
221
184project 222project
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
210rgb = \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0) 249rgb = \(a :: _) (b :: _) (c :: _) -> _rhs (V4 a b c 1.0)
250
211black = _rhs (rgb 0.0 0.0 0.0) 251black = _rhs (rgb 0.0 0.0 0.0)
252
212gray = _rhs (rgb 0.5 0.5 0.5) 253gray = _rhs (rgb 0.5 0.5 0.5)
254
213silver = _rhs (rgb 0.75 0.75 0.75) 255silver = _rhs (rgb 0.75 0.75 0.75)
256
214white = _rhs (rgb 1.0 1.0 1.0) 257white = _rhs (rgb 1.0 1.0 1.0)
258
215maroon = _rhs (rgb 0.5 0.0 0.0) 259maroon = _rhs (rgb 0.5 0.0 0.0)
260
216red = _rhs (rgb 1.0 0.0 0.0) 261red = _rhs (rgb 1.0 0.0 0.0)
262
217olive = _rhs (rgb 0.5 0.5 0.0) 263olive = _rhs (rgb 0.5 0.5 0.0)
264
218yellow = _rhs (rgb 1.0 1.0 0.0) 265yellow = _rhs (rgb 1.0 1.0 0.0)
266
219green = _rhs (rgb 0.0 0.5 0.0) 267green = _rhs (rgb 0.0 0.5 0.0)
268
220lime = _rhs (rgb 0.0 1.0 0.0) 269lime = _rhs (rgb 0.0 1.0 0.0)
270
221teal = _rhs (rgb 0.0 0.5 0.5) 271teal = _rhs (rgb 0.0 0.5 0.5)
272
222aqua = _rhs (rgb 0.0 1.0 1.0) 273aqua = _rhs (rgb 0.0 1.0 1.0)
274
223navy = _rhs (rgb 0.0 0.0 0.5) 275navy = _rhs (rgb 0.0 0.0 0.5)
276
224blue = _rhs (rgb 0.0 0.0 1.0) 277blue = _rhs (rgb 0.0 0.0 1.0)
278
225purple = _rhs (rgb 0.5 0.0 0.5) 279purple = _rhs (rgb 0.5 0.0 0.5)
280
226fuchsia = _rhs (rgb 1.0 0.0 1.0) 281fuchsia = _rhs (rgb 1.0 0.0 1.0)
282
227colorImage1 = _rhs (ColorImage @(fromInt 1)) 283colorImage1 = _rhs (ColorImage @(fromInt 1))
284
228colorImage2 = _rhs (ColorImage @(fromInt 2)) 285colorImage2 = _rhs (ColorImage @(fromInt 2))
286
229depthImage1 = _rhs (DepthImage @(fromInt 1)) 287depthImage1 = _rhs (DepthImage @(fromInt 1))
288
230v3FToV4F :: Vec (fromInt 3) Float -> Vec (fromInt 4) Float 289v3FToV4F :: Vec (fromInt 3) Float -> Vec (fromInt 4) Float
231v3FToV4F 290v3FToV4F
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
234radians = _rhs PrimRadians 294radians = _rhs PrimRadians
295
235degrees = _rhs PrimDegrees 296degrees = _rhs PrimDegrees
297
236sin = _rhs PrimSin 298sin = _rhs PrimSin
299
237cos = _rhs PrimCos 300cos = _rhs PrimCos
301
238tan = _rhs PrimTan 302tan = _rhs PrimTan
303
239sinh = _rhs PrimSinH 304sinh = _rhs PrimSinH
305
240cosh = _rhs PrimCosH 306cosh = _rhs PrimCosH
307
241tanh = _rhs PrimTanH 308tanh = _rhs PrimTanH
309
242asin = _rhs PrimASin 310asin = _rhs PrimASin
311
243asinh = _rhs PrimASinH 312asinh = _rhs PrimASinH
313
244acos = _rhs PrimACos 314acos = _rhs PrimACos
315
245acosh = _rhs PrimACosH 316acosh = _rhs PrimACosH
317
246atan = _rhs PrimATan 318atan = _rhs PrimATan
319
247atanh = _rhs PrimATanH 320atanh = _rhs PrimATanH
321
248atan2 = _rhs PrimATan2 322atan2 = _rhs PrimATan2
323
249pow = _rhs PrimPow 324pow = _rhs PrimPow
325
250exp = _rhs PrimExp 326exp = _rhs PrimExp
327
251log = _rhs PrimLog 328log = _rhs PrimLog
329
252exp2 = _rhs PrimExp2 330exp2 = _rhs PrimExp2
331
253log2 = _rhs PrimLog2 332log2 = _rhs PrimLog2
333
254sqrt = _rhs PrimSqrt 334sqrt = _rhs PrimSqrt
335
255inversesqrt = _rhs PrimInvSqrt 336inversesqrt = _rhs PrimInvSqrt
337
256abs = _rhs PrimAbs 338abs = _rhs PrimAbs
339
257sign = _rhs PrimSign 340sign = _rhs PrimSign
341
258floor = _rhs PrimFloor 342floor = _rhs PrimFloor
343
259trunc = _rhs PrimTrunc 344trunc = _rhs PrimTrunc
345
260round = _rhs PrimRound 346round = _rhs PrimRound
347
261roundEven = _rhs PrimRoundEven 348roundEven = _rhs PrimRoundEven
349
262ceil = _rhs PrimCeil 350ceil = _rhs PrimCeil
351
263fract = _rhs PrimFract 352fract = _rhs PrimFract
353
264mod = _rhs PrimMod 354mod = _rhs PrimMod
355
265min = _rhs PrimMin 356min = _rhs PrimMin
357
266max = _rhs PrimMax 358max = _rhs PrimMax
359
267modF = _rhs PrimModF 360modF = _rhs PrimModF
361
268clamp = _rhs PrimClamp 362clamp = _rhs PrimClamp
363
269clampS = _rhs PrimClampS 364clampS = _rhs PrimClampS
365
270mix = _rhs PrimMix 366mix = _rhs PrimMix
367
271mixS = _rhs PrimMixS 368mixS = _rhs PrimMixS
369
272mixB = _rhs PrimMixB 370mixB = _rhs PrimMixB
371
273step = _rhs PrimStep 372step = _rhs PrimStep
373
274stepS = _rhs PrimStepS 374stepS = _rhs PrimStepS
375
275smoothstep = _rhs PrimSmoothStep 376smoothstep = _rhs PrimSmoothStep
377
276smoothstepS = _rhs PrimSmoothStepS 378smoothstepS = _rhs PrimSmoothStepS
379
277isNan = _rhs PrimIsNan 380isNan = _rhs PrimIsNan
381
278isInf = _rhs PrimIsInf 382isInf = _rhs PrimIsInf
383
279dFdx = _rhs PrimDFdx 384dFdx = _rhs PrimDFdx
385
280dFdy = _rhs PrimDFdy 386dFdy = _rhs PrimDFdy
387
281fWidth = _rhs PrimFWidth 388fWidth = _rhs PrimFWidth
389
282noise1 = _rhs PrimNoise1 390noise1 = _rhs PrimNoise1
391
283noise2 = _rhs PrimNoise2 392noise2 = _rhs PrimNoise2
393
284noise3 = _rhs PrimNoise3 394noise3 = _rhs PrimNoise3
395
285noise4 = _rhs PrimNoise4 396noise4 = _rhs PrimNoise4
397
286length = _rhs PrimLength 398length = _rhs PrimLength
399
287distance = _rhs PrimDistance 400distance = _rhs PrimDistance
401
288dot = _rhs PrimDot 402dot = _rhs PrimDot
403
289cross = _rhs PrimCross 404cross = _rhs PrimCross
405
290normalize = _rhs PrimNormalize 406normalize = _rhs PrimNormalize
407
291faceforward = _rhs PrimFaceForward 408faceforward = _rhs PrimFaceForward
409
292reflect = _rhs PrimReflect 410reflect = _rhs PrimReflect
411
293refract = _rhs PrimRefract 412refract = _rhs PrimRefract
413
294transpose = _rhs PrimTranspose 414transpose = _rhs PrimTranspose
415
295det = _rhs PrimDeterminant 416det = _rhs PrimDeterminant
417
296inv = _rhs PrimInverse 418inv = _rhs PrimInverse
419
297outer = _rhs PrimOuterProduct 420outer = _rhs PrimOuterProduct
421
298bAnd = _rhs PrimBAnd 422bAnd = _rhs PrimBAnd
423
299bOr = _rhs PrimBOr 424bOr = _rhs PrimBOr
425
300bXor = _rhs PrimBXor 426bXor = _rhs PrimBXor
427
301bNot = _rhs PrimBNot 428bNot = _rhs PrimBNot
429
302bAndS = _rhs PrimBAndS 430bAndS = _rhs PrimBAndS
431
303bOrS = _rhs PrimBOrS 432bOrS = _rhs PrimBOrS
433
304bXorS = _rhs PrimBXorS 434bXorS = _rhs PrimBXorS
435
305shiftL = _rhs PrimBShiftL 436shiftL = _rhs PrimBShiftL
437
306shiftR = _rhs PrimBShiftR 438shiftR = _rhs PrimBShiftR
439
307shiftLS = _rhs PrimBShiftLS 440shiftLS = _rhs PrimBShiftLS
441
308shiftRS = _rhs PrimBShiftRS 442shiftRS = _rhs PrimBShiftRS
443
309floatBitsToInt = _rhs PrimFloatBitsToInt 444floatBitsToInt = _rhs PrimFloatBitsToInt
445
310floatBitsToWord = _rhs PrimFloatBitsToUInt 446floatBitsToWord = _rhs PrimFloatBitsToUInt
447
311intBitsToFloat = _rhs PrimIntBitsToFloat 448intBitsToFloat = _rhs PrimIntBitsToFloat
449
312wordBitsToFloat = _rhs PrimUIntBitsToFloat 450wordBitsToFloat = _rhs PrimUIntBitsToFloat
451
313infixl 7 * 452infixl 7 *
453
314infixl 7 / 454infixl 7 /
455
315infixl 7 % 456infixl 7 %
457
316infixl 6 + 458infixl 6 +
459
317infixl 6 - 460infixl 6 -
461
318infix 4 /= 462infix 4 /=
463
319infix 4 < 464infix 4 <
465
320infix 4 <= 466infix 4 <=
467
321infix 4 >= 468infix 4 >=
469
322infix 4 > 470infix 4 >
471
323infixr 3 && 472infixr 3 &&
473
324infixr 2 || 474infixr 2 ||
475
325infix 7 dot 476infix 7 dot
477
326infix 7 cross 478infix 7 cross
479
327infixr 7 *. 480infixr 7 *.
481
328infixl 7 .* 482infixl 7 .*
483
329infixl 7 .*. 484infixl 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
335neg = \(a :: _) -> _rhs (PrimNeg a) 496neg = \(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
343xor = _rhs PrimXor 512xor = _rhs PrimXor
513
344not = \(a :: _) -> _rhs (PrimNot a) 514not = \(a :: _) -> _rhs (PrimNot a)
515
345any = \(a :: _) -> _rhs (PrimAny a) 516any = \(a :: _) -> _rhs (PrimAny a)
517
346all = \(a :: _) -> _rhs (PrimAll a) 518all = \(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
350infixl 7 *! 526infixl 7 *!
527
351infixl 7 /! 528infixl 7 /!
529
352infixl 7 %! 530infixl 7 %!
531
353infixl 6 +! 532infixl 6 +!
533
354infixl 6 -! 534infixl 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
360perspective 546perspective
361 :: Float -> Float -> Float -> Float -> Mat (fromInt 4) (fromInt 4) Float 547 :: Float -> Float -> Float -> Float -> Mat (fromInt 4) (fromInt 4) Float
362perspective 548perspective
@@ -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
379rotMatrixZ 566rotMatrixZ
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
386rotMatrixY 574rotMatrixY
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
393rotMatrixX 582rotMatrixX
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
400rotationEuler 590rotationEuler
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
403translateBefore4 :: Vec (fromInt 3) Float -> Mat (fromInt 4) (fromInt 4) Float 594translateBefore4 :: Vec (fromInt 3) Float -> Mat (fromInt 4) (fromInt 4) Float
404translateBefore4 595translateBefore4
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
416lookat 608lookat
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
437scale = \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0) 630scale = \(a :: _) (b :: _) -> _rhs (b * V4 a a a 1.0)
631
438fromTo :: Float -> Float -> [Float] 632fromTo :: Float -> Float -> [Float]
439fromTo 633fromTo
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
456main is not found
457------------ trace 651------------ trace
458const :: forall a b . a -> b -> a 652const :: forall a b . a -> b -> a
459otherwise :: Bool 653otherwise :: Bool