joeyh at
This is also an area where Haskell shines. There are some built-in types for Rationals, and it's also well-supported to build your own numeric data types and use all the regular operators with them. (I did it with shell-monad.)
Unbounded integers that are built into the core language are something I would have trouble living without in any language now. Haskell's are based on gmp, and are efficient enough that I use them almost everywhere -- saves thinking about dealing with overflow.
The only slightly annoying thing is that due to strict typing, fromIntegral
is sometimes needed to cast to the desired type.
Haskell also has efficient (ie, not church encode) type-level naturals now.. :)
Charles Stanhope likes this.