-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul Data.ByteString.Builder.RealFloat #636
Comments
(Sorry for taking so long to respond.) |
Builder is an intriguing idea instead of char. I'll have to think about that since it does allow for more than one Word8 to be inserted. I think 6 and 7 are somewhat related and it seems worth it to consolidate for the faster determination of special values for the standard case. |
This comment was marked as outdated.
This comment was marked as outdated.
I see you're doing a lot of work in various PRs in this area. Please let me know when each one is ready for review, and which ones to start with/prioritize. |
@clyring Please focus on
The others can come later. |
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
formatFloat
andformatDouble
intoformatFloating :: FloatFormat -> a -> Builder
since they have the same logic and use classes to get their specific functions based on the floating type. Continuing exporting theformatFloat
andformatDouble
interface functions for compatibility.FloatFormat
to the constructors ofFormatMode
and remove the typeFormatMode
because the precision(Maybe Int)
is not used and can be included as a parameter of the constructorsFScientific
should have aChar
for specifying a lower or upper EFStandard
should have aMaybe Int
for the precisionFGeneric
should have a Char for specifying a lower or upper E, and two Ints for the inclusive exponent range for printing the standard notationdata SpecialStrings = {..}
specialStr
and usetoCharsNonNumbersAndZero
instead because they duplicate logic and it is faster to evaluate\f -> ...
should be defined after the case statement and not before.None of these changes should cause changes to the existing interface.
The text was updated successfully, but these errors were encountered: