<p>In order to represent Z/nZ, regular way need to store two integers, and a data constructer. With number parameterized types, newtype+Integer can be used, it&#39;s much more efficient.<br>
For this project, montg reduce require to calculate a key for each modulus, but the modulus won&#39;t be changed within Num typeclass. It&#39;s better to fix it in type system.</p>
<div class="gmail_quote">On Nov 7, 2011 1:38 AM, &quot;DavidA&quot; &lt;<a href="mailto:polyomino@f2s.com">polyomino@f2s.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What&#39;s the purpose of all the type trickery?<br>
Why not just implement the algorithm using Integer?<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>