[project @ 1997-03-14 07:52:06 by simonpj]
[ghc-hetmet.git] / ghc / lib / tests / Array / arr009 / Main.hs
diff --git a/ghc/lib/tests/Array/arr009/Main.hs b/ghc/lib/tests/Array/arr009/Main.hs
new file mode 100644 (file)
index 0000000..a6fe26e
--- /dev/null
@@ -0,0 +1,17 @@
+-- Array - derived ops
+-- 
+-- testing the well-behavedness of 
+-- derived ops for empty and non-empty arrays
+--
+import Array
+
+main = 
+ let 
+  a1 = array (1,0) ([]::[(Int,Int)])
+  a2 = array (1,26) (zip [1..] ['a'..'z'])
+
+  dump a = (bounds a, indices a, elems a, assocs a)
+ in
+ print (dump a1) >>
+ print (dump a2)
+