
20 Jan
2012
20 Jan
'12
9:03 a.m.
Hello, What's the recommended way for serializing (with the cereal package) an UTCTime? It's easy to give Serialize instances for UTCTime and Day: instance Serialize UTCTime where get = liftM2 UTCTime get get put (UTCTime day time) = put day >> put time instance Serialize Day where get = liftM Day get put = put . toModifiedJulianDay However I have no idea how to serialize the DiffTime stored in an UTCTime: instance Serialize DiffTime where get = ? put = ? Regards, Bas