Skip to content

export Data.IntSet.Internal.lowestBitSet, highestBitSet, revNat #668

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

Closed
jwaldmann opened this issue Jul 20, 2019 · 3 comments
Closed

export Data.IntSet.Internal.lowestBitSet, highestBitSet, revNat #668

jwaldmann opened this issue Jul 20, 2019 · 3 comments

Comments

@jwaldmann
Copy link
Contributor

While working on #470 I noticed this in the source of Data.IntSet.Internal:

  For lowestBitSet we use wordsize-dependant implementation based on
  multiplication and DeBrujn indeces, which was proposed by Edward Kmett
  <http://haskell.org/pipermail/libraries/2011-September/016749.html>

  The core of this implementation is fast indexOfTheOnlyBit,
  which is given a Nat with exactly one bit set, and returns
  its index.

  Lot of effort was put in these implementations, please benchmark carefully
  before changing this code.

Don't these belong in Data.Bits then, so they can be re-used? This was already suggested in
https://mail.haskell.org/pipermail/libraries/2011-September/016755.html
https://mail.haskell.org/pipermail/libraries/2011-September/016756.html

@jwaldmann
Copy link
Contributor Author

@jwaldmann
Copy link
Contributor Author

But is it really? It has highestBitMask but not lowestBitSet etc.

@jwaldmann jwaldmann reopened this Jul 20, 2019
@jwaldmann
Copy link
Contributor Author

jwaldmann commented Jul 31, 2019

not needed, as GHC.Exts has clt, ctz and so on https://hackage.haskell.org/package/base-4.12.0.0/docs/GHC-Exts.html#v:clz-35-

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

No branches or pull requests

1 participant