derive & Drift - some help please

Hi, I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it. I tried to understand the respective user manuals but it's still all Greek to me. Someone please help! Günther

You shouldn't need any extra tools for this. A combination of the
StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers,
S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi Sterling, sry, but I can't get it to work. Günther Sterling Clover schrieb:
You shouldn't need any extra tools for this. A combination of the StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers, S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
mailto:gue.schmidt@web.de> wrote: Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

What problems are you encountering?
Alex
On Sun, Mar 8, 2009 at 11:58 AM, G?uenther Schmidt
Hi Sterling,
sry, but I can't get it to work.
Günther
Sterling Clover schrieb:
You shouldn't need any extra tools for this. A combination of the StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers, S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
mailto:gue.schmidt@web.de> wrote: Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi Alexander, well I have this: newtype AdmissionDate = AdmDt LocalTime deriving (Data,Typeable ..) at least that's where I wonna get. I don't know how to create the proper instance declarations though for LocalTime. AdmissionDate is an element of a larger data structure, this data structure for instance also has a newtype DischargeDate = DchrgDt LocalTime deriving (Data,Typeable ...) With my haskell work so far I was blessedly free of the need for deriving. Until now ... Günther Alexander Dunlap schrieb:
What problems are you encountering?
Alex
On Sun, Mar 8, 2009 at 11:58 AM, G?uenther Schmidt
wrote: Hi Sterling,
sry, but I can't get it to work.
Günther
Sterling Clover schrieb:
You shouldn't need any extra tools for this. A combination of the StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers, S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
mailto:gue.schmidt@web.de> wrote: Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Well you can do
deriving instance Typeable LocalType
etc. if you enable the DeriveDataTypeable and StandaloneDeriving extensions. You will get other error messages for missing instances; just keep adding
deriving instance Typeable Day
etc. Eventually, you will need to implement an instance by hand for
Pico, because Pico's data constructors are not exported from
Data.Fixed. I'm not very familiar with Data and Typeable so I can't
help you there, but you can probably look at some existing instances
for help.
Hope that's useful for you.
Alex
On Sun, Mar 8, 2009 at 12:40 PM, Gü?nther Schmidt
Hi Alexander,
well I have this:
newtype AdmissionDate = AdmDt LocalTime deriving (Data,Typeable ..)
at least that's where I wonna get.
I don't know how to create the proper instance declarations though for LocalTime.
AdmissionDate is an element of a larger data structure, this data structure for instance also has a
newtype DischargeDate = DchrgDt LocalTime deriving (Data,Typeable ...)
With my haskell work so far I was blessedly free of the need for deriving. Until now ...
Günther
Alexander Dunlap schrieb:
What problems are you encountering?
Alex
On Sun, Mar 8, 2009 at 11:58 AM, G?uenther Schmidt
wrote: Hi Sterling,
sry, but I can't get it to work.
Günther
Sterling Clover schrieb:
You shouldn't need any extra tools for this. A combination of the StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers, S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
mailto:gue.schmidt@web.de> wrote: Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi Alexander, this does the trick! Günther Alexander Dunlap schrieb:
Well you can do
deriving instance Typeable LocalType
etc. if you enable the DeriveDataTypeable and StandaloneDeriving extensions. You will get other error messages for missing instances; just keep adding
deriving instance Typeable Day
etc. Eventually, you will need to implement an instance by hand for Pico, because Pico's data constructors are not exported from Data.Fixed. I'm not very familiar with Data and Typeable so I can't help you there, but you can probably look at some existing instances for help.
Hope that's useful for you.
Alex
On Sun, Mar 8, 2009 at 12:40 PM, Gü?nther Schmidt
wrote: Hi Alexander,
well I have this:
newtype AdmissionDate = AdmDt LocalTime deriving (Data,Typeable ..)
at least that's where I wonna get.
I don't know how to create the proper instance declarations though for LocalTime.
AdmissionDate is an element of a larger data structure, this data structure for instance also has a
newtype DischargeDate = DchrgDt LocalTime deriving (Data,Typeable ...)
With my haskell work so far I was blessedly free of the need for deriving.. Until now ...
Günther
Alexander Dunlap schrieb:
What problems are you encountering?
Alex
On Sun, Mar 8, 2009 at 11:58 AM, G?uenther Schmidt
wrote: Hi Sterling,
sry, but I can't get it to work.
Günther
Sterling Clover schrieb:
You shouldn't need any extra tools for this. A combination of the StandaloneDeriving and DeriveDataTypeable extensions in GHC should suffice.
Cheers, S.
On Sun, Mar 8, 2009 at 10:30 AM, Gü?nther Schmidt
mailto:gue.schmidt@web.de> wrote: Hi,
I need to derive Data, Typeable for Data.Time.LocalTime. I had hoped to use either derive or DrIFT to generate the instance declarations for it.
I tried to understand the respective user manuals but it's still all Greek to me.
Someone please help!
Günther
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Alexander Dunlap
-
G?uenther Schmidt
-
Gü?nther Schmidt
-
Sterling Clover