[Haskell-cafe] Small question

Sebastian Sylvan sebastian.sylvan at gmail.com
Thu Aug 9 14:28:41 EDT 2007


On 09/08/07, Stefan O'Rear <stefanor at cox.net> 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.

Ah good point. Well I'd guess a Word8 would do (might be faster to use
a Word32 or Word64 depending on your machine though?).


-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862


More information about the Haskell-Cafe mailing list