Generics missing Data instances...

2004-02-26 Thread MR K P SCHUPKE

There appears to be no instance for Double values in the
Generics.Basic

Also no instance for Ptr.

am I not importing the right file, or does this need to be fixed?

Regards,
Keean Schupke.

PS. This is with ghc-6.2
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: Generics... no Tuples 2 either...

2004-02-26 Thread Abraham Egnor
I've been frustrated by the same lack of instances; as a stopgap, here's
one for a three-tuple.  The pattern is pretty clear and can easily be
extended to whatever size you'd like.

tupCon = mkConstr 1 (,,) Prefix

instance (Data a, Data b, Data c) = Data (a, b ,c) where
gfoldl k z (a, b, c) = ((z (,,) `k` a) `k` b) `k` c
toConstr _ = tupCon
fromConstr _ = (undefined, undefined, undefined)
dataTypeOf _ = mkDataType [tupCon]

MR K P SCHUPKE [EMAIL PROTECTED] writes:

Any chance of Data instances for tuples of size
greater than 2... One of the nice things about generics is
you can use them by deriving Data on your datatypes - of
course this doesn't work if you all of a sudden have to 
put a load of boiler-plate in just to use tuples...

   Regards,
   Keean Schupke
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users




___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users