import Prelude
import Control.Concurrent.MVar
+import Data.Typeable
+
+#include "Typeable.h"
-- General semaphores are also implemented readily in terms of shared
-- @MVar@s, only have to catch the case when the semaphore is tried
-- \"quantity\" is always dealt with in units of one.
newtype QSem = QSem (MVar (Int, [MVar ()]))
+INSTANCE_TYPEABLE0(QSem,qSemTc,"QSem")
+
-- |Build a new 'QSem'
newQSem :: Int -> IO QSem
newQSem init = do