haskell / primitive

This package provides various primitive memory-related operations.
Other
114 stars 58 forks source link

Show instance of bytearray suppresses leading zeroes in octets #306

Closed andrewthad closed 3 years ago

andrewthad commented 3 years ago

Currently, the Show instance of ByteArray gives this:

[0xb, 0x1f, 0x5]

instead of this:

[0x0b, 0x1f, 0x05]

I find the latter preferably. I'm going to leave this open to solicit feedback.

chessai commented 3 years ago

+1 to change

On Tue, Apr 27, 2021, 18:24 Andrew Martin @.***> wrote:

Currently, the Show instance of ByteArray gives this:

[0xb, 0x1f, 0x5]

instead of this:

[0x0b, 0x1f, 0x05]

I find the latter preferably. I'm going to leave this open to solicit feedback.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell/primitive/issues/306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOIX25PRBFYZ7RVM3NCUXDTK5BS3ANCNFSM43V56ASQ .

treeowl commented 3 years ago

Yes, I think you're right. Both are correct, but filling out the last byte will give more readable, more easily aligned output. +1

On Tue, Apr 27, 2021, 7:39 PM chessai @.***> wrote:

+1 to change

On Tue, Apr 27, 2021, 18:24 Andrew Martin @.***> wrote:

Currently, the Show instance of ByteArray gives this:

[0xb, 0x1f, 0x5]

instead of this:

[0x0b, 0x1f, 0x05]

I find the latter preferably. I'm going to leave this open to solicit feedback.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell/primitive/issues/306, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEOIX25PRBFYZ7RVM3NCUXDTK5BS3ANCNFSM43V56ASQ

.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haskell/primitive/issues/306#issuecomment-828026899, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOF7P333LZQDCDMAP37MDTK5DM5ANCNFSM43V56ASQ .

andrewthad commented 3 years ago

Alright, I'm going to go ahead with this. Any thoughts on whether or not to do a major version bump for this? Technically, it's a breaking change, but I'm not aware of anything outside of test suites that even uses the Show instance of ByteArray.

andrewthad commented 3 years ago

This will be resolved by https://github.com/haskell/primitive/pull/309. Any comments there would be appreciated.