[project @ 2004-03-27 13:18:12 by panne]
[ghc-base.git] / Data / Dynamic.hs
index 0a9c116..a43cc18 100644 (file)
@@ -47,9 +47,6 @@ import GHC.Base
 import GHC.Show
 import GHC.Err
 import GHC.Num
-import GHC.Float
-import GHC.Real( rem )
-import GHC.IOBase
 #endif
 
 #ifdef __HUGS__
@@ -67,10 +64,10 @@ unsafeCoerce = unsafeCoerce#
 #ifdef __NHC__
 import NonStdUnsafeCoerce (unsafeCoerce)
 import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO)
-#else
-#include "Typeable.h"
 #endif
 
+#include "Typeable.h"
+
 -------------------------------------------------------------
 --
 --             The type Dynamic
@@ -91,9 +88,7 @@ import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO)
 data Dynamic = Dynamic TypeRep Obj
 #endif
 
-#ifndef __NHC__
 INSTANCE_TYPEABLE0(Dynamic,dynamicTc,"Dynamic")
-#endif
 
 instance Show Dynamic where
    -- the instance just prints the type representation.
@@ -157,7 +152,7 @@ fromDynamic (Dynamic t v) =
 -- (f::(a->b)) `dynApply` (x::a) = (f a)::b
 dynApply :: Dynamic -> Dynamic -> Maybe Dynamic
 dynApply (Dynamic t1 f) (Dynamic t2 x) =
-  case applyTy t1 t2 of
+  case funResultTy t1 t2 of
     Just t3 -> Just (Dynamic t3 ((unsafeCoerce f) x))
     Nothing -> Nothing