I have data defined like the ff.:
import Data.Time.Clock
data D = D { ...,
someDate :: UTCTime,
... }
deriving (Eq, Show)
When I compile it, I get the ff. error:
No instance for (Show UTCTime)
arising from the 'deriving' clause of a data type declaration
at ...
I already have the time-1.1.3 package which should already have this instance according to documentation. My GHC version is 6.8.2.
Don’t import each piece of the
Data.Timesuite separately. It’s designed for you to import justData.Time, and that will pull in just about everything that is commonly used.Including the
Showinstance forUTCTime.If you don’t want that much namespace clutter, import just the symbols you need:
or whatever else. That’s anyway a good idea – it protects you against name clashes
later on if the library gets updated and starts using a name that you have already
defined.