GithubHelp home page GithubHelp logo

bits's People

Contributors

deviant-logic avatar ekmett avatar hvr avatar luke-clifton avatar mdeland avatar phadej avatar ryanglscott avatar watashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bits's Issues

Data.Bits.Extras.oneBits clashes with Data.Bits.oneBits in GHC 9.2

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:

  1. Hide Data.Bits' oneBits when importing it throughout bits and continue defining Data.Bits.Extras' version separately.
  2. Re-export 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.