Repository navigation
Reduce code size, use base libraries instead of NIH, use bytestring - #2
Merged
Merged
Conversation
+ `Data.ByteArray.Encoding`: replaced custom Base16/Base32/Base64 encode/decode with `base16`, `base32`, and `base64` library calls. Input is converted to `ByteString` via `B.convert`, the library function is applied, and the result is converted back. `Base64OpenBSD` retains its custom implementation (no library equivalent exists). + `Data.ByteArray.Bytes`: replaced low-level `GHC.Prim` `MutableByteArray#` implementation with `newtype Bytes = Bytes ByteString`. Both use GHC's pinned allocator; `ByteString` already implements `ByteArrayAccess` / `ByteArray`. + `Data.Memory.Hash.FNV`: replaced `readWord8OffAddr#` (GHC.Prim) with `Foreign.Storable.peekByteOff` — portable and equivalent. + `Data.Memory.Internal.CompatPrim64`: deleted (was entirely unreferenced). + New dependencies: `base16 >=1.0 && <2`, `base32 >=0.4 && <1`, `base64 >=1.0 && <2`, `text >=1.0 && <3`. + Net reduction: ~350 lines removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Data.ByteArray.Encoding: replaced custom Base16/Base32/Base64 encode/decode withbase16,base32, andbase64library calls. Input is converted toByteStringviaB.convert, the library function is applied, and the result is converted back.Base64OpenBSDretains its custom implementation (no library equivalent exists).Data.ByteArray.Bytes: replaced low-levelGHC.PrimMutableByteArray#implementation withnewtype Bytes = Bytes ByteString. Both use GHC's pinned allocator;ByteStringalready implementsByteArrayAccess/ByteArray.Data.Memory.Hash.FNV: replacedreadWord8OffAddr#(GHC.Prim) withForeign.Storable.peekByteOff— portable and equivalent.Data.Memory.Internal.CompatPrim64: deleted (was entirely unreferenced).base16 >=1.0 && <2,base32 >=0.4 && <1,base64 >=1.0 && <2,text >=1.0 && <3.