From: simonmar Date: Wed, 11 Dec 2002 15:55:17 +0000 (+0000) Subject: [project @ 2002-12-11 15:55:17 by simonmar] X-Git-Tag: nhc98-1-18-release~788 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3a3c5dde1a91357fa258682510f75e37e0340913;p=ghc-base.git [project @ 2002-12-11 15:55:17 by simonmar] Obj type must be forall a.a now, to avoid confusing GHC's new tail-calling scheme. --- diff --git a/Data/Dynamic.hs b/Data/Dynamic.hs index c67ea20..6379d33 100644 --- a/Data/Dynamic.hs +++ b/Data/Dynamic.hs @@ -110,8 +110,16 @@ instance Show Dynamic where showsPrec 0 t . showString ">>" -data Obj = Obj - -- dummy type to hold the dynamically typed value. +type Obj = forall a . a + -- Dummy type to hold the dynamically typed value. + -- + -- In GHC's new eval/apply execution model this type must + -- be polymorphic. It can't be a constructor, because then + -- GHC will use the constructor convention when evaluating it, + -- and this will go wrong if the object is really a function. On + -- 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). -- | A concrete representation of a (monomorphic) type. 'TypeRep' -- supports reasonably efficient equality.