<div class="gmail_extra">On Tue, Apr 24, 2012 at 3:20 PM, KC <span dir="ltr"><<a href="mailto:kc1956@gmail.com" target="_blank">kc1956@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>initIdentityMat :: Int -> ST s (STUArray s (Int,Int) ((Int, Int), Double))</div><div>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)])</div>
<div><br></div><div>Doesn't seem to compile, nor do minor variations of the type declaration.</div></blockquote><div><br></div><div>If you use Hoogle to find the type and API docs for 'newListArray', I believe you'll be able to figure out what's wrong, but I'll give you a hint. The list you're giving to 'newListArray' contains too much; and the pair you give it is only half correct.</div>
<div><br></div><div>Kevin</div><div><span style="color:rgb(136,136,136)"><br></span></div><div><span style="color:rgb(136,136,136)">-- </span></div></div>Kevin Charter<br><a href="mailto:kevin.charter@acm.org">kevin.charter@acm.org</a><br>
</div>