From ddd44df5d307dc863afe6eb2216761cb9f44a389 Mon Sep 17 00:00:00 2001 From: malcolm Date: Wed, 18 Dec 2002 10:43:38 +0000 Subject: [PATCH] [project @ 2002-12-18 10:43:38 by malcolm] Make it compilable with nhc98, although for now it omits all instances. --- Data/Dynamic.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Data/Dynamic.hs b/Data/Dynamic.hs index e55dae6..e603933 100644 --- a/Data/Dynamic.hs +++ b/Data/Dynamic.hs @@ -89,7 +89,12 @@ unsafeCoerce :: a -> b unsafeCoerce = unsafeCoerce# #endif +#ifdef __NHC__ +import NonStdUnsafeCoerce (unsafeCoerce) +import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO) +#else #include "Dynamic.h" +#endif {-| A value of type 'Dynamic' is an object encapsulated together with its type. @@ -355,6 +360,7 @@ instance (Typeable a, Typeable b) => Typeable (a -> b) where typeOf f = mkFunTy (typeOf ((undefined :: (a -> b) -> a) f)) (typeOf ((undefined :: (a -> b) -> b) f)) +#ifndef __NHC__ INSTANCE_TYPEABLE0(Bool,boolTc,"Bool") INSTANCE_TYPEABLE0(Char,charTc,"Char") INSTANCE_TYPEABLE0(Float,floatTc,"Float") @@ -383,7 +389,6 @@ INSTANCE_TYPEABLE0(TyCon,tyconTc,"TyCon") INSTANCE_TYPEABLE0(TypeRep,typeRepTc,"TypeRep") INSTANCE_TYPEABLE0(Dynamic,dynamicTc,"Dynamic") -#ifndef __NHC__ #include "Dynamic.h" INSTANCE_TYPEABLE1(IORef,ioRefTc,"IORef") #endif -- 1.7.10.4