Replace deprecated data-binary-ieee754 package with GHC.Float #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the deprecated
data-binary-ieee754package with equivalent functions fromGHC.Float(part of thebasepackage). Thedata-binary-ieee754package hasn't been updated in over 10 years and is marked as deprecated.Changes
The following conversions were made:
Data.Binary.IEEE754.floatToWord→GHC.Float.castFloatToWord32Data.Binary.IEEE754.doubleToWord→GHC.Float.castDoubleToWord64Data.Binary.IEEE754.wordToFloat→GHC.Float.castWord32ToFloatData.Binary.IEEE754.wordToDouble→GHC.Float.castWord64ToDoubleData.Binary.IEEE754.getFloat32le→ customgetFloat32leusingcastWord32ToFloat <$> getWord32leData.Binary.IEEE754.getFloat64le→ customgetFloat64leusingcastWord64ToDouble <$> getWord64leTesting
All existing tests pass (90/90), including:
The GHC.Float functions have been available since GHC 7.8 and are part of the standard
basepackage, making this a safe and future-proof replacement.Fixes #71
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.