blob: 0bd22ab78710ee5ec307bab516cb58115475a12a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
-- !!! Check the Read instance for Array
-- [Not strictly a 'deriving' issue]
module Main( main ) where
import Data.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)
}
|