diff options
author | ross <unknown> | 2003-01-23 17:45:42 +0000 |
---|---|---|
committer | ross <unknown> | 2003-01-23 17:45:42 +0000 |
commit | 8e100c7e08b03a4aca6b6a6404a2a4e26d1e375f (patch) | |
tree | 24286fa8d2cf2639c0daf8725cc0f8a424c462c7 /libraries/base/Data/Dynamic.hs | |
parent | 64d3b396c0cf08de5801bcdefbdd0e80c1756d89 (diff) | |
download | haskell-8e100c7e08b03a4aca6b6a6404a2a4e26d1e375f.tar.gz |
[project @ 2003-01-23 17:45:40 by ross]
Hugs now uses most of Control.Exception.
Diffstat (limited to 'libraries/base/Data/Dynamic.hs')
-rw-r--r-- | libraries/base/Data/Dynamic.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/base/Data/Dynamic.hs b/libraries/base/Data/Dynamic.hs index e603933fee..2ca46895a6 100644 --- a/libraries/base/Data/Dynamic.hs +++ b/libraries/base/Data/Dynamic.hs @@ -79,6 +79,7 @@ import GHC.IOBase #endif #ifdef __HUGS__ +import Hugs.Prelude import Hugs.IO import Hugs.IORef import Hugs.IOExts @@ -106,7 +107,9 @@ import NHC.IOExtras (IORef,newIORef,readIORef,writeIORef,unsafePerformIO) 'Show'ing a value of type 'Dynamic' returns a pretty-printed representation of the object\'s type; useful for debugging. -} +#ifndef __HUGS__ data Dynamic = Dynamic TypeRep Obj +#endif instance Show Dynamic where -- the instance just prints the type representation. @@ -126,16 +129,18 @@ type Obj = forall a . a -- the other hand, if we use a polymorphic type, GHC will use -- a fallback convention for evaluating it that works for all types. -- (using a function type here would also work). -#else +#elif !defined(__HUGS__) data Obj = Obj #endif -- | A concrete representation of a (monomorphic) type. 'TypeRep' -- supports reasonably efficient equality. +#ifndef __HUGS__ data TypeRep = App TyCon [TypeRep] | Fun TypeRep TypeRep deriving ( Eq ) +#endif instance Show TypeRep where showsPrec p (App tycon tys) = @@ -156,10 +161,12 @@ instance Show TypeRep where -- | An abstract representation of a type constructor. 'TyCon' objects can -- be built using 'mkTyCon'. +#ifndef __HUGS__ data TyCon = TyCon Int String instance Eq TyCon where (TyCon t1 _) == (TyCon t2 _) = t1 == t2 +#endif instance Show TyCon where showsPrec _ (TyCon _ s) = showString s |