summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail128.hs
blob: 08971837a238e2ec1d9ea32f5fb1abdc9e59768e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


-- Ambiguity error reporting

module Main where

import Data.Array.MArray (thaw,freeze)
import Data.Array.Unboxed as UA (UArray,listArray)
import Data.Array.IArray as IA (Array,listArray)

main :: IO ()
main = do let sL = [1,4,6,3,2,5]
	      dim = length sL
	      help :: [FlatVector]
	      help = [listFlatVector (1,s) [0|i<-[1..s]]|s<-sL]   
	      tmp :: Vector FlatVector 
	      tmp = listVector (1,dim) help
	  v <- thaw tmp
	  return ()

type FlatVector  = UArray Int Double

listFlatVector :: (Int,Int) -> [Double] -> FlatVector
listFlatVector = UA.listArray

type Vector a = Array Int a

listVector :: (Int,Int) -> [a] -> Vector a
listVector = IA.listArray