[Haskell-cafe] Natural Numbers: Best implementation?
g9ks157k at acme.softbase.org
Fri Mar 13 04:23:03 EDT 2009
Am Freitag, 13. März 2009 04:01 schrieb Alexander Dunlap:
> > 2. Use the type
> > data Natural = Zero | Succ !Natural
> In terms of speed, I think that  would be reasonably fast (unless
> you do a ton of subtraction with bounds-checking) and  would
> probably be quite slow, because you don't get the speed-boost from
> doing computations right on the processor.
Not only that but also because operations like addition now take at least
More information about the Haskell-Cafe