ee84b9bd7aa945b46a160745761f89726f3c5f7e
[packages/dph.git] / dph-test / fusion / Main.hs
1
2
3 module Main where
4 import Data.Vector.Unboxed as V
5 import Prelude as P
6 import Unboxed
7
8
9 test :: Vector Int
10 -> Vector Int
11 -> Vector Int
12
13 test aa bb
14 = V.zipWith3
15 (\x y z -> x + y + z)
16 aa
17 bb
18 (V.replicate (V.length aa) 12345)
19
20
21 test2 :: Vector Int
22 -> Vector Int
23 -> Vector Int
24
25 test2 aa bb
26 = lockedZipWith3
27 (\x y z -> x + y + z)
28 aa
29 bb
30 (V.replicate (V.length aa) 12345)
31
32 main
33 = do let xs1 = V.fromList [1, 2, 3, 4, 5]
34 let xs2 = V.fromList [6, 7, 8, 9, 9]
35
36 print $ test xs1 xs2
37 print $ test2 xs1 xs2