You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iso8601ParseM @IO @CalendarDiffTime "P-1MT-1S"
*** Exception: user error (no parse of "P-1MT-1S")
Whilst it seems like the ISO8601 standard may not explicitly support negative interval durations, the Haskell type does, and a variety of tools including PostgreSQL understand negative values within intervals, so I think crashing here is a greater evil than extending the formatting standard to support values the type already supports.
As an example reference: PostgreSQL specifically supports minus signs in the components but not a preceding sign over the entire time interval:
Didn't see anything in the changelog so I initially assumed the upgrade wouldn't fix it, I suppose the "fix show of CalendarDiffTime" may have also included iso8601 show/parseM instances as well?
Parsing of course has the equivalent issue:
Whilst it seems like the ISO8601 standard may not explicitly support negative interval durations, the Haskell type does, and a variety of tools including PostgreSQL understand negative values within intervals, so I think crashing here is a greater evil than extending the formatting standard to support values the type already supports.
As an example reference: PostgreSQL specifically supports minus signs in the components but not a preceding sign over the entire time interval:
The text was updated successfully, but these errors were encountered: