Primitive types and Prelude shenanigans

William Lee Irwin III wli@holomorphy.com
Mon, 12 Feb 2001 00:43:57 -0800


It seems to me that some additional primitive types would be useful,
most of all a natural number type corresponding to an arbitrary-
precision unsigned integer. Apparently Integer is defined in terms
of something else in the GHC Prelude, what else might be needed to
define it?

Some of my other natural thoughts along these lines are positive
reals and rationals, and nonzero integers. Rationals I have an idea
that they might be similar to natural numbers and nonzero integers,
though the nonzero and positive reals pose some nasty problems
(try underflow).

Would such machinations be useful to anyone else?

Further down this line, I've gone off and toyed with Bool, and
discovered GHC doesn't like it much. Is there a particular place within
GHC I should look to see how the primitive Boolean type, and perhaps
other types are handled? I'd also like to see where some of the magic
behind the typing of various other built-in constructs happens, like
list comprehensions, tuples, and derived classes.


Cheers,
Bill