[project @ 2005-01-19 22:33:32 by ralf]
[ghc-base.git] / Data / Generics / Instances.hs
index f6e3be0..1157dc5 100644 (file)
@@ -34,7 +34,10 @@ import Data.Word             -- So we can give Data instance for Word8, ...
 import GHC.Real( Ratio(..) ) -- So we can give Data instance for Ratio
 import GHC.IOBase           -- So we can give Data instance for IO, Handle
 import GHC.Ptr              -- So we can give Data instance for Ptr
+import GHC.ForeignPtr       -- So we can give Data instance for ForeignPtr
 import GHC.Stable           -- So we can give Data instance for StablePtr
+import GHC.ST               -- So we can give Data instance for ST
+import GHC.Conc                     -- So we can give Data instance for MVar & Co.
 
 #include "Typeable.h"
 
@@ -548,3 +551,57 @@ instance Typeable a => Data (IORef a) where
 
 
 ------------------------------------------------------------------------------
+
+
+instance Typeable a => Data (ForeignPtr a) where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.ForeignPtr.ForeignPtr"
+
+
+------------------------------------------------------------------------------
+
+
+instance (Typeable s, Typeable a) => Data (ST s a) where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.ST.ST"
+
+
+------------------------------------------------------------------------------
+
+
+instance Data ThreadId where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.Conc.ThreadId"
+
+
+------------------------------------------------------------------------------
+
+
+instance Typeable a => Data (TVar a) where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.Conc.TVar"
+
+
+------------------------------------------------------------------------------
+
+
+instance Typeable a => Data (MVar a) where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.Conc.MVar"
+
+
+------------------------------------------------------------------------------
+
+
+instance Typeable a => Data (STM a) where
+  toConstr _   = error "toConstr"
+  gunfold _ _  = error "gunfold"
+  dataTypeOf _ = mkNorepType "GHC.Conc.STM"
+
+
+------------------------------------------------------------------------------