Take account of injectivity when doing fundeps
[ghc.git] / testsuite / tests / typecheck / should_fail / tcfail128.hs
1
2
3 -- Ambiguity error reporting
4
5 module Main where
6
7 import Data.Array.MArray (thaw,freeze)
8 import Data.Array.Unboxed as UA (UArray,listArray)
9 import Data.Array.IArray as IA (Array,listArray)
10
11 main :: IO ()
12 main = do let sL = [1,4,6,3,2,5]
13 dim = length sL
14 help :: [FlatVector]
15 help = [listFlatVector (1,s) [0|i<-[1..s]]|s<-sL]
16 tmp :: Vector FlatVector
17 tmp = listVector (1,dim) help
18 v <- thaw tmp
19 return ()
20
21 type FlatVector = UArray Int Double
22
23 listFlatVector :: (Int,Int) -> [Double] -> FlatVector
24 listFlatVector = UA.listArray
25
26 type Vector a = Array Int a
27
28 listVector :: (Int,Int) -> [a] -> Vector a
29 listVector = IA.listArray