cvs commit: fptools/libraries/base/Data Array.hs FiniteMap.hs IntMap.hs IntSet.hs Map.hs Set.hs Typeable.hs fptools/libraries/base/Data/Generics Instances.hs fptools/libraries/base/GHC Conc.lhs ForeignPtr.hs

Simon Peyton-Jones simonpj at microsoft.com
Tue Feb 1 08:38:37 EST 2005


But neither of you need or want Data instances, right?

S

| -----Original Message-----
| From: Malcolm Wallace [mailto:Malcolm.Wallace at cs.york.ac.uk]
| Sent: 01 February 2005 11:20
| Cc: ross at soi.city.ac.uk; Simon Peyton-Jones;
cvs-libraries at haskell.org; ralf at haskell.org
| Subject: Re: cvs commit: fptools/libraries/base/Data Array.hs
FiniteMap.hs IntMap.hs IntSet.hs
| Map.hs Set.hs Typeable.hs fptools/libraries/base/Data/Generics
Instances.hs
| fptools/libraries/base/GHC Conc.lhs ForeignPtr.hs
| 
| ross at soi.city.ac.uk writes:
| 
| > On Tue, Feb 01, 2005 at 08:57:46AM -0000, Simon Peyton-Jones wrote:
| > >
| > > I think that neither Hugs nor NHC grok the Data class, so we can
use
| > > 'deriving( Data )' freely (surrounded with #ifdef
__GLASGOW_HASKELL__,
| > > of course).  Is that right?
| >
| > So this sort of thing should be fine with Hugs and (I think) Nhc98:
| >
| > import Data.Typeable
| > #ifdef __GLASGOW_HASKELL__
| > import Data.Generics.Basics
| > import Data.Generics.Instances
| > #else
| > #include "Typeable.h"
| > #endif
| >
| > ...
| >
| > data Set a    = Tip
| >               | Bin {-# UNPACK #-} !Size a !(Set a) !(Set a)
| > #ifdef __GLASGOW_HASKELL__
| >         deriving (Typeable, Data)
| > #else
| > INSTANCE_TYPEABLE1(Set,setTc,"Set")
| > #endif
| 
| Yes, I think that is right for nhc98 too.
| Regards,
|     Malcolm


More information about the Cvs-libraries mailing list