[Haskell-cafe] memorize function with number parameterized types in GHC

Bin Jin bjin1990 at gmail.com
Sun Nov 6 18:47:11 CET 2011

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's much more efficient.
For this project, montg reduce require to calculate a key for each modulus,
but the modulus won't be changed within Num typeclass. It's better to fix
it in type system.
On Nov 7, 2011 1:38 AM, "DavidA" <polyomino at f2s.com> wrote:

> What's the purpose of all the type trickery?
> Why not just implement the algorithm using Integer?
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111107/b2d57054/attachment.htm>

More information about the Haskell-Cafe mailing list