[project @ 1998-12-02 13:17:09 by simonm]
[ghc-hetmet.git] / ghc / lib / std / PrelDynamic.lhs
1 %
2 % (c) AQUA Project, Glasgow University, 1998
3 %
4
5 The Dynamic type is used in the Exception type, so we have to have
6 Dynamic visible here.  The rest of the operations on Dynamics are
7 available in exts/Dynamic.lhs.
8
9 \begin{code}
10 {-# OPTIONS -fno-implicit-prelude #-}
11
12 #ifndef __HUGS__
13 module PrelDynamic where
14
15 import PrelBase
16 #endif
17
18 data Dynamic = Dynamic TypeRep Obj
19
20 data Obj = Obj  
21  -- dummy type to hold the dynamically typed value.
22
23 data TypeRep
24  = App TyCon   [TypeRep]
25  | Fun TypeRep TypeRep
26    deriving ( Eq )
27
28 -- type constructors are 
29 data TyCon = TyCon Int String
30
31 instance Eq TyCon where
32   (TyCon t1 _) == (TyCon t2 _) = t1 == t2
33 \end{code}