Bools are not unboxed

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Sun Oct 3 09:18:15 EDT 2004


On Sun, Oct 03, 2004 at 03:07:01PM +0200, Tomasz Zielonka wrote:
> Then I noticed the cause: 
>     GHC.Prim.<# returns a boxed, heap allocated Bool, and so do other
>     primitive comparison operators.
> 
> Would it be difficult to add Bool unboxing to GHC?
> Maybe it would suffice to use preallocated False and True?

I forgot about some questions:

Do you think that many applications could benefit from such an improvement?

IMO, yes, for example, there are many Int comparisons waiting for this
optimisation in io, networking and posix libraries. But I am not sure
how big would that benefit be in a non-toy application.

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links


More information about the Glasgow-haskell-users mailing list