2 Jun 2002 10:51
Re: Dynamic types: GHCI works, GHC doesn't?
John Meacham <john <at> repetae.net>
2002-06-02 08:51:58 GMT
2002-06-02 08:51:58 GMT
just as a note, the new version of DrIFT (which i now maintain) has the ability to derive 'Typeable', which is used for the Strafunski generic programming representation (which it also can derive..) the homepage is now at 'http://repetae.net/john/computer/haskell/DrIFT' I sort of fudged the Typeable derivation rule, if someone wanted to robustify it, i would gladly accept patches. I dont think that 'unsafe' need be added to Typeable since hopefully people will never be creating instances themselves, with the instances hidden behind DrIFT and/or 'deriving' clauses then they can be assured of being correct (well... as correct as anything is :)) . Typeable itself is not inherently unsafe, it is broken implementations of it which are. John On Sun, Jun 02, 2002 at 12:11:49PM +1000, Andre Pang wrote: > On Sat, Jun 01, 2002 at 07:56:39PM +0100, Alastair Reid wrote: > > > Your Typeable instance looks like this: > > > > > instance Typeable FootnoteData where > > > typeOf _ = mkAppTy (mkTyCon "FootnoteData") [typeOf ("Foo" :: String), typeOf (7 :: Int)] > > > > This should be written: > > > > > instance Typeable FootnoteData where > > > typeOf _ = mkAppTy fdtc [typeOf ("Foo" :: String), typeOf (7 :: Int)] > > > > > > fdtc = mkTyCon "FootnoteData" > >(Continue reading)
RSS Feed