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