summaryrefslogtreecommitdiff
path: root/test/Main.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-04-17 12:18:49 +0200
committerTom Smeding <tom@tomsmeding.com>2024-04-17 12:18:49 +0200
commit4fa4f193bdba187deb7ead0ff839c78c25125c7b (patch)
tree572de7a812eb69805da77bd7eecf3ed48356a626 /test/Main.hs
parente29ab5d55be1c9cf60d4c795dc85388181a2e64b (diff)
Allow generating an empty array
Diffstat (limited to 'test/Main.hs')
-rw-r--r--test/Main.hs7
1 files changed, 7 insertions, 0 deletions
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