Closed centromere closed 7 years ago
Could you explain a bit more about your use case?
I don't like breaking the API so in order to do this I need to add the following new functions:
toNonNormalizedDecimalDigits
formatNonNormalizedScientific
Data.ByteString.Builder.Scientific.formatNonNormalizedScientificBuilder
formatScientificBuilder.formatNonNormalizedScientificBuilder
I need to have a good reason to justify this API increase.
I'm accepting HTTP requests, converting them to JSON-RPC requests, and sending them off to RabbitMQ. The HTTP requests include authentication headers (HMAC signature and timestamp to prevent replay attacks). The timestamp can be fractional, and is represented as a Scientific. The problem is that since the timestamp is signed, it has to be represented exactly as the client sent it in the HTTP headers. Normalization can prevent the signatures from being verified properly.
I think I would accept a PR for this.
Must it be strictly non-breaking?
I recently ran in to an issue where I needed to print out non-normalized Scientific values. The pretty-printing functions normalize by default, and there's no way to configure it. It would be super helpful if
formatScientificBuilder
took an extra Bool argument specifying the normalization preference.