Skip to content
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

Move all endianness/byte-order CPP into one module #659

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

clyring
Copy link
Member

@clyring clyring commented Feb 14, 2024

I can't be bothered to remember the right combination of #include ... and #ifdef to check this. So I'd like to remove the need entirely.

, whenBigEndian
) where

data ByteOrder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we reuse GHC.ByteOrder.ByteOrder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense to do so. It can wait until I make a pass at removing the various old-ghc cruft, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we can already reuse the type itself?..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's added in base-4.11 while we currently have base >= 4.9. I guess there is a compatibility package ghc-byteorder but that seems like re-arranging deck chairs on the Titanic since we will discontinue support for such old ghc versions at our convenience.

This isn't a battle worth fighting, though.


module Data.ByteString.Utils.ByteOrder
( ByteOrder(..)
, hostByteOrder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the name intentionally different from targetByteOrder for cross-compilation purposes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since bytestring is not a compiler the notion of "target" doesn't really make sense. The name in base is confusing.

@clyring clyring merged commit 161780a into haskell:master Feb 15, 2024
26 checks passed
@clyring clyring added this to the 0.12.1.0 milestone Feb 15, 2024
clyring added a commit that referenced this pull request Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants