AJChapman / formatting

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

putting double-conversion behind a build flag? #80

Closed juhp closed 1 year ago

juhp commented 2 years ago

The double-conversion dependency seems quite heavy and there are many use-cases that don't need formatting of floating point.

So I'd like to suggest the idea of putting the usage of double-conversion under a Cabal flag (which can still default to true) to allow easily building formatting without double-conversion. How do you think?

AJChapman commented 2 years ago

Sure, if it's useful to you then put in a pull request and I'd be happy to merge it.

ysangkok commented 1 year ago

I submitted a PR that also tweaks the implementation when not using the double-conversion library. I did this because the tests were failing. But if you want, I can also submit a smaller PR that just introduces the avoid-double-conversion flag, and makes the ghcjs code branch get used when the flag is set. I am a bit puzzled the tests are failing at all. Possibly ghcjs has a different printf implementation? We could also have a three way ifdef, if the current ghcjs implementation is somehow to be desired when actually running on ghcjs.