From 4fa4f193bdba187deb7ead0ff839c78c25125c7b Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 17 Apr 2024 12:18:49 +0200 Subject: Allow generating an empty array --- test/Main.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/Main.hs') diff --git a/test/Main.hs b/test/Main.hs index 1619c00..d29e4d5 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -15,8 +15,15 @@ arr = rgenerate (3 ::: 4 ::: IZR) $ \(i ::: j ::: IZR) -> foo :: (Double, Int) foo = arr `rindex` (2 ::: 1 ::: IZR) `sindex` (1 ::$ 1 ::$ IZS) +bad :: Ranked I2 (Ranked I1 Double) +bad = rgenerate (3 ::: 4 ::: IZR) $ \(i ::: j ::: IZR) -> + rgenerate (i ::: IZR) $ \(k ::: IZR) -> + let s = 24*i + 6*j + 3*k + in fromIntegral s + main :: IO () main = do print arr print foo print (rtranspose [1,0] arr) + -- print bad -- cgit v1.2.3-70-g09d2