
However because Int is often unboxable where as Integer is never unboxable there are certainly programs where the factor is much much greater than x2 or x3. If the Int can be unboxed into an Int# then the operations are very quick indeed as they are simple machine primitives.
This has made me wonder whether we are better off getting rid of the small integer optimization and turning Integer into a straight unboxable ForeignPtr to a GMP number. this would also mean we could use the standard GMP that comes with the system since ForeignPtr will take care of GCing Integers itself. This was my plan with jhc, but at the moment, Integer is still just intmax_t. Another option would be to keep the small integer optimization but make it CPR data Integer = Integer Int# !(Ptr MPZ) where if the Ptr is NULL then the Int# contains the value... John -- John Meacham - ⑆repetae.net⑆john⑈