Skip to content

Remove deepseq reimplementation

The HpcCombine.hs module contains a "reimplementation" of deepseq:


-- What I would give for a hyperstrict :-)
-- This makes things about 100 times faster.
class Strict a where
   strict :: a -> a

instance Strict Integer where
   strict i = i

instance Strict Int where
   strict i = i

instance Strict Hash where      -- should be fine, because Hash is a newtype round an Int
   strict i = i

instance Strict Char where
   strict i = i

instance Strict a => Strict [a] where
   strict (a:as) = (((:) $! strict a) $! strict as)
   strict []     = []

instance (Strict a, Strict b) => Strict (a,b) where
   strict (a,b) = (((,) $! strict a) $! strict b)

instance Strict Tix where
  strict (Tix t1) =
            Tix $! strict t1

instance Strict TixModule where
  strict (TixModule m1 p1 i1 t1) =
            ((((TixModule $! strict m1) $! strict p1) $! strict i1) $! strict t1)

I have already added the necessary NFData instances upstream in the hpc-library in 0.6.2.0. But this version is not yet released on Hackage.