-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
Hi,
I’m trying to convert an Expr CalendarDiffTime (which is an output of diffTime) to an Expr Double.
I have a function calendarDiffTimeToDoubleDays that works for converting from CalendarTime to Double.
However, since Expr isn’t a Functor, I’m not sure how to apply this conversion directly to the Expr type.
calendarDiffTimeToDoubleDays :: CalendarDiffTime -> Double
calendarDiffTimeToDoubleDays (CalendarDiffTime cmonths ctime) =
monthsToDays + picosToDay
where
-- Convert months to days (approximation)
monthsToDays = fromIntegral cmonths * 30.436875
-- Convert picosecondes to days
picosToDay = realToFrac $ ctime / nominalDay
Is there a way to achieve this transformation, or would I need to approach it differently?
Thanks for your help!
Metadata
Metadata
Assignees
Labels
No labels