summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/array/should_run/arr009.hs
blob: 290147d0a08524db4a8385e083107305b5f5d107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- !!! Array - derived ops
-- 
-- testing the well-behavedness of 
-- derived ops for empty and non-empty arrays
--
import Data.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)