christian-marie / time-qq

Haskell QuasiQuoting for times.
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

instance Lift UTCTime requires 64 bit Int type #7

Open ddssff opened 2 years ago

ddssff commented 2 years ago

The Lift instances for UTCTime use fromEnum, which converts to Int. On a machine with 32 bit ints this means only DiffTimes of less than 3 milliseconds will convert correctly.

ddssff commented 2 years ago

I suggest this:

instance Q.Lift UTCTime where
  lift t = [|read $(Q.lift (show t))|]