ekmett / bits Goto Github PK
View Code? Open in Web Editor NEWBit twiddling and bitwise serialization primitives
Home Page: http://rebase.org/bits
License: Other
Bit twiddling and bitwise serialization primitives
Home Page: http://rebase.org/bits
License: Other
If you try to build bits
with base-4.16
(bundled with GHC 9.2), you'll get this error:
[1 of 3] Compiling Data.Bits.Extras ( src/Data/Bits/Extras.hs, interpreted )
src/Data/Bits/Extras.hs:210:39: error:
Ambiguous occurrence ‘oneBits’
It could refer to
either ‘Data.Bits.oneBits’,
imported from ‘Data.Bits’ at src/Data/Bits/Extras.hs:34:1-16
or ‘Data.Bits.Extras.oneBits’,
defined at src/Data/Bits/Extras.hs:204:1
|
210 | srl b n = (b `shiftR` n) .&. rotateR (oneBits `shiftL` n) n
| ^^^^^^^
This is because Data.Bits
now defines a function named oneBits
as well. It is almost the same as the oneBits
function defined in Data.Bits.Extras
, but with one key difference—Data.Bits
' oneBits
has a FiniteBits
constraint, while Data.Bits.Extras
' oneBits
has a Bits
constraint. Note that some functions currently rely on the weaker Bits
constraint (e.g., Data.Bits.Extras.srl
), so the two are not interchangeable.
How should we address this? I see two possibilities:
Data.Bits
' oneBits
when importing it throughout bits
and continue defining Data.Bits.Extras
' version separately.Data.Bits
' oneBits
when building with base-4.16
or later, and on older versions of base
, define a compatibility shim for oneBits
with a FiniteBits
constraint.I'd personally prefer possibility (2), although that would require a breaking change.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.