Monthly Archives: February 2009

Ever wondered how big a closure is?

Somebody asked me yesterday how to find out how big the runtime representation of a type is. I hacked this up using the internal unpackClosure# primitive: {-# LANGUAGE MagicHash,UnboxedTuples #-} module Size where import GHC.Exts import Foreign unsafeSizeof :: a … Continue reading

Posted in Uncategorized | 5 Comments