haskell / time

A time library

Home Page:http://hackage.haskell.org/package/time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic instances for UTCTime, Day etc.

ocramz opened this issue · comments

I just noticed UTCTime and Day don't have a Generic instance. I think they should have one instead, to facilitate interoperability with other libraries.

I believe they should be treated as atomic? See #45, #99.

On one hand I agree, but on the other if the question keeps popping up there might be a need for this. I'm thinking of serialization to/from CSV files, database entries and similar.
Perhaps the instance could come with a note of warning to library authors.

Day is a newtype of Integer, so it should certainly be treated as atomic. Likewise, for something like a database, UTCTime is always going to be represented as a single database column, so it should also be atomic.