ghc-9.2.1 unboxed types compatibility

Hello, A significant number of libraries are broken by the changes in unboxed types. A lot of them are in the process (or already have) of adding compatibility layers to allow them to support the new version while preserving compatibility with older ones, introducing code like : #if MIN_VERSION_base(4,16,0) word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# = word32ToWord# #else word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# x = x #endif for the functions they use (usually a small subset). Some of the solutions appear to differ. Is there a preferred way to make this consistently or/and avoid unnecessary code duplication ? Thanks Bruno

Well, maybe, but I have seen this in : base16-bytestring basement streaming-commons iproute hashtables So it seems quite widespread… especially as a number of common libraries depend on these (persistent for example) BTW there are a number of patches in headhackage for these -- Sent from Canary (https://canarymail.io)
On Saturday, Nov 06, 2021 at 12:52 PM, Henning Thielemann
wrote: On Sat, 6 Nov 2021, Bruno Damour wrote:
A significant number of libraries are broken by the changes in unboxed types.
I have seen some breakage because of W# vs. W32#. But I suspect that those libraries do not really need to be implemented that low-level.

On Sat, Nov 06, 2021 at 11:15:37AM +0100, Bruno Damour wrote:
A lot of them are in the process (or already have) of adding compatibility layers to allow them to support the new version while preserving compatibility with older ones, introducing code like :
#if MIN_VERSION_base(4,16,0) word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# = word32ToWord# #else word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# x = x #endif for the functions they use (usually a small subset).
Some of the solutions appear to differ.
Is there a preferred way to make this consistently or/and avoid unnecessary code duplication ?
Since the above is what the head.hackage maintainers are doing, I assumed that's the way to go. On Sat, Nov 06, 2021 at 01:08:01PM +0100, Bruno Damour wrote:
... but I have seen this in:
base16-bytestring basement streaming-commons iproute hashtables
So it seems quite widespread… especially as a number of common libraries depend on these (persistent for example)
An updated iproute 1.7.12 is now released, using the head.hackage approach. -- Viktor.

I’d just release a new version for GHC 9.2.1 forward (I know that solution is unpopular!) - particularly since Word32# seems “more correct" Otherwise I use cpphs.
On Nov 6, 2021, at 5:15 AM, Bruno Damour
wrote: Hello,
A significant number of libraries are broken by the changes in unboxed types.
A lot of them are in the process (or already have) of adding compatibility layers to allow them to support the new version while preserving compatibility with older ones, introducing code like :
#if MIN_VERSION_base(4,16,0) word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# = word32ToWord# #else word32ToWordCompat# :: Word32# -> Word# word32ToWordCompat# x = x #endif for the functions they use (usually a small subset).
Some of the solutions appear to differ.
Is there a preferred way to make this consistently or/and avoid unnecessary code duplication ?
Thanks
Bruno
_______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (4)
-
Bruno Damour
-
Henning Thielemann
-
Vanessa McHale
-
Viktor Dukhovni