AJChapman / formatting

Format strings type-safely with combinators
BSD 3-Clause "New" or "Revised" License
164 stars 39 forks source link

timeSpecs causes a commitAndReleaseBuffer error #29

Closed ivan-m closed 7 years ago

ivan-m commented 7 years ago

If two TimeSpec values are extremely close together (e.g. (TimeSpec {sec = 43948, nsec = 402952718}, TimeSpec {sec = 43948, nsec = 402964296})) then the timeSpecs formatter will print out a value in microseconds with " µs" as the units. This can hit this GHC bug resulting in an error message like the following:

commitAndReleaseBuffer: invalid argument (invalid character)

(I've just spent way too long thinking it was some situation of only happening inside a case statement or something because that's actually where my timings were close enough to cause it to happen.)

Would it be possible to change this to just use " us" for portability?

chrisdone commented 7 years ago

Sure.