[Haskell-cafe] Small question

Andrew Coppin andrewcoppin at btinternet.com
Thu Aug 9 16:27:23 EDT 2007

Stefan O'Rear wrote:
> On Thu, Aug 09, 2007 at 07:12:12PM +0100, Sebastian Sylvan wrote:
>> {-#OPTIONS -funbox-strict-fields #-}
>> data Quad = Quad !Bool !Bool
>> foo True True = ...
>> foo True False = ....
>> ... etc...
>> The GHC option just causese GHC to unbox primitive types when they're
>> strict in the data type, and the bangs cause them to be strict.
> Unfortunately, Bool is not a sufficiently primitive type for that to
> work.
> Stefan
Don't ya just hate it when that happens? (I.e., you say something and 
sound all cleaver, and then an expert points out that "actually, no".) 
Happens to me all the time... heh.

OOC, in what way is Bool not "primitive enough"? You mean because it's 
an algebraic data type, rather than a bunch of bits in the machine? For 
that matter, just how much space does such a type typically use?

(Questions, questions, so many questions...)

More information about the Haskell-Cafe mailing list