[Haskell-cafe] Small question

Stefan O'Rear stefanor at cox.net
Fri Aug 10 01:54:35 EDT 2007


On Thu, Aug 09, 2007 at 11:09:36PM -0400, ajb at spamcop.net wrote:
> 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. :-)

Not sure where that came from; my filters are usually better than that
:)

> > 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.)

That was actually described in the first paper on first-class unboxed
types.  The paper described a general mechanism for declaring
user-defined unboxed types and procedures for unboxing any ADT.  No idea
if it was ever implemented, though.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20070809/18c3a049/attachment.bin


More information about the Haskell-Cafe mailing list