RE: Question about literals in the core-language

I'm working at comparing the ghc-core-language with another lambda-calculus. This calculus has no unboxed values, but normal constructors are available. My problem is now: How can I represent the unboxed values in my calculus. More precisely: Can I represent the unboxed values by a finite set of constants, or include the literals also integers, which can be infinite? If that is the case, how are the (unboxed) integers represented in the ghc-core-language?
First, there is a distinction between unboxed and unlifted types. An unlifted type is one who's domain of values does not include _|_. All of GHC's primitive types(*) are unlifted. An unboxed type is unlifted, but also it is not represented by a pointer. Its representation depends on the type (eg. Int# is a 32- or 64-bit signed integral value). Integers do not have associated primitive types. An Integer in GHC is defined as data Integer = S# Int# -- small integers | J# Int# ByteArray# -- large integers Cheers, Simon (*) well, except for RealWorld, but that is Deeply Special anyway.
participants (1)
-
Simon Marlow