I am having trouble with the type declaration for creating an identity matrix.

24 Apr
2012
24 Apr
'12
5:20 p.m.
initIdentityMat :: Int -> ST s (STUArray s (Int,Int) ((Int, Int), Double)) initIdentityMat m = newListArray ((1,m),(1,m)) ([((i,j), if i == j then 1.0 else 0.0) | i <- [1..m], j <- [1..m]] :: [((Int,Int), Double)]) Doesn't seem to compile, nor do minor variations of the type declaration. -- -- Regards, KC
4773
Age (days ago)
4773
Last active (days ago)
0 comments
1 participants
participants (1)
-
KC