Commit b99f4d4b authored by simonpj's avatar simonpj
Browse files

[project @ 2002-06-07 15:50:22 by simonpj]

Add an array read and show test
parent 2ed68806
......@@ -13,3 +13,4 @@ test "drvrun005" { vtr("", "", "") }
test "drvrun006" { vtr("", "", "") }
test "drvrun007" { vtr("", "", "") }
test "drvrun008" { vtr("-funbox-strict-fields", "", "") }
test "drvrun009" { vtr("", "", "") }
-- !!! Check the Read instance for Array
-- [Not strictly a 'deriving' issue]
module Main( main ) where
import Array
bds :: ((Int,Int),(Int,Int))
bds = ((1,4),(2,5))
type MyArr = Array (Int,Int) Int
a :: MyArr
a = array bds [ ((i,j), i+j) | (i,j) <- range bds ]
main = do { putStrLn (show a) ;
let { b :: MyArr ;
b = read (show a) } ;
putStrLn (show b)
}
array ((1,4),(2,5)) [((1,4),5),((1,5),6),((2,4),6),((2,5),7)]
array ((1,4),(2,5)) [((1,4),5),((1,5),6),((2,4),6),((2,5),7)]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment