Ticket #5431 (closed feature request: fixed)
Add popCount to Data.Bits
| Reported by: | tibbe | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 7.4.1 |
| Component: | libraries/base | Version: | 7.2.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Now when we have a fast popCnt# primop it would be nice to expose it to the world through an official API. I propose we add this method to the Bits class in Data.Bits:
-- | Return the number of set bits in the argument, know as the -- population count or the Hamming weight. popCount :: a -> Int
The proposal was discussed and agreed upon in this thread: http://thread.gmane.org/gmane.comp.lang.haskell.libraries/16073
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

