<div class="gmail_extra">Thank you.<br><br>One is ONLY supposed to supply the list elements for &quot;newListArray&quot; which fill the array in increasing order.<br><br><br><div class="gmail_quote">On Tue, Apr 24, 2012 at 3:21 PM, Kevin Charter <span dir="ltr">&lt;<a href="mailto:kcharter@gmail.com" target="_blank">kcharter@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="im">On Tue, Apr 24, 2012 at 3:20 PM, KC <span dir="ltr">&lt;<a href="mailto:kc1956@gmail.com" target="_blank">kc1956@gmail.com</a>&gt;</span> wrote:<br>
</div><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>initIdentityMat :: Int -&gt; 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 &lt;- [1..m], j &lt;- [1..m]] :: [((Int,Int), Double)])</div>


<div><br></div><div>Doesn&#39;t seem to compile, nor do minor variations of the type declaration.</div></blockquote><div><br></div></div></div><div>If you use Hoogle to find the type and API docs for &#39;newListArray&#39;, I believe you&#39;ll be able to figure out what&#39;s wrong, but I&#39;ll give you a hint. The list you&#39;re giving to &#39;newListArray&#39; contains too much; and the pair you give it is only half correct.</div>
<span class="HOEnZb"><font color="#888888">
<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></font></span></div><span class="HOEnZb"><font color="#888888">Kevin Charter<br>
<a href="mailto:kevin.charter@acm.org" target="_blank">kevin.charter@acm.org</a><br>

</font></span></div>
</blockquote></div><br><br clear="all"><br>-- <br>--<br>Regards,<br>KC<br>
</div>