-
Couldn't load subscription status.
- Fork 144
Open
Description
I have created the following PRs but they seem to be intermingled and perhaps a larger pull would be better
#632
#633
#634
I propose the following
- combine the logic of
formatFloatandformatDoubleintoformatFloating :: FloatFormat -> a -> Buildersince they have the same logic and use classes to get their specific functions based on the floating type. Continuing exporting theformatFloatandformatDoubleinterface functions for compatibility. - Replace the constructor of
FloatFormatto the constructors ofFormatModeand remove the typeFormatModebecause the precision(Maybe Int)is not used and can be included as a parameter of the constructors FScientificshould have aCharfor specifying a lower or upper EFStandardshould have aMaybe Intfor the precisionFGenericshould have a Char for specifying a lower or upper E, and two Ints for the inclusive exponent range for printing the standard notation- Allow custom strings for special values +-Infinity +-0 NaN with
data SpecialStrings = {..} - remove
specialStrand usetoCharsNonNumbersAndZeroinstead because they duplicate logic and it is faster to evaluate - I am unsure if this is optimized away but the case statement that selects the format should not be executed for every floating number to be printed. If not, the
\f -> ...should be defined after the case statement and not before.
None of these changes should cause changes to the existing interface.
Metadata
Metadata
Assignees
Labels
No labels