[Haskell-cafe] Small question

ajb at spamcop.net ajb at spamcop.net
Thu Aug 9 23:09:36 EDT 2007

G'day all.

Quoting Stefan O'Rear <stefanor at cox.net>:

> In general, GHC doesn't do "unboxing".  Instead it has a simpler and
> more general approach, [...]

I'm not convinced that the phrase "more general" is appropriate here. :-)

> As far as actual heap usage goes, GHC creates single static values for
> all 0-argument constructors; so all Bool WHNFs are one of two addresses,
> one for True and one for False.

And, of course, if it's a strict argument, then the values stored are
ALWAYS one of two possibilities.  So as a matter of curiosity, would
there be any advantage at all for "unboxing" enumeration types?  (Apart
from, I suppose, the possibility of using fewer than 32/64 bits to store
a flag.)

Andrew Bromage

More information about the Haskell-Cafe mailing list