Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumieval/word-compat
Compatibility shim for GHC's small integer primitives
https://github.com/fumieval/word-compat
haskell
Last synced: 23 days ago
JSON representation
Compatibility shim for GHC's small integer primitives
- Host: GitHub
- URL: https://github.com/fumieval/word-compat
- Owner: fumieval
- Created: 2022-03-18T05:10:10.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T07:58:44.000Z (about 2 years ago)
- Last Synced: 2023-04-10T16:42:55.952Z (over 1 year ago)
- Topics: haskell
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/word-compat
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# word-compat
[![Hackage](https://img.shields.io/hackage/v/word-compat.svg)](https://hackage.haskell.org/package/word-compat)
![Haskell CI](https://github.com/fumieval/word-compat/workflows/Haskell%20CI/badge.svg)Since GHC 9.2, [Small Word and Int types are now defined in terms of the new primitives with corresponding sizes, not Word# Int#](https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0074-small-primitives.rst).
This broke a (somewhat surprising) number of code, leaving a bunch of packages still behind GHC 9.2.This package provides pattern synonyms that resemble the old constructors of small Int/Word types, and you can save a lot of work of explicitly writing `wordXXToWord` and `wordToWordXX` for each use site.
Most likely you'll be able to get your code buildable just by replacing `GHC.Word` by `GHC.Word.Compat`.