formatTime doesn't work with local time ??

My error: Couldn't match expected type `T.UTCTime' against inferred type `T.LocalTime' In the second argument of `formatTime', namely `date' In the expression: formatTime "%Y/%m/%e %k:%M:%S" date But the docs have LocalTime listed as one of the FormatTime instances: Instances FormatTime Day FormatTime UTCTime FormatTime TimeZone FormatTime TimeOfDay FormatTime ZonedTime FormatTime LocalTime ? Brian

On Wed, 20 Jan 2010 07:15:07 -0800
Brian Denheyer
My error:
Couldn't match expected type `T.UTCTime' against inferred type `T.LocalTime' In the second argument of `formatTime', namely `date' In the expression: formatTime "%Y/%m/%e %k:%M:%S" date
Nevermind... I had defined : formatTime = T.formatTime defaultTimeLocale which used the T.formatTime for the UTCTime instance. The following T.formatTime defaultTimeLocale "%Y/%m/%e %k:%M:%S" date works just fine (date is Localtime) Brian

Am Mittwoch 20 Januar 2010 16:42:56 schrieb Brian Denheyer:
On Wed, 20 Jan 2010 07:15:07 -0800
Brian Denheyer
wrote: My error:
Couldn't match expected type `T.UTCTime' against inferred type `T.LocalTime' In the second argument of `formatTime', namely `date' In the expression: formatTime "%Y/%m/%e %k:%M:%S" date
Nevermind...
I had defined :
formatTime = T.formatTime defaultTimeLocale
which used the T.formatTime for the UTCTime instance. The following
T.formatTime defaultTimeLocale "%Y/%m/%e %k:%M:%S" date
works just fine (date is Localtime)
Brian
Monomorphism restriction, I presume?
participants (2)
-
Brian Denheyer
-
Daniel Fischer