Opened 8 years ago

Closed 8 years ago

#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 Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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:

Attachments (1)

0001-Add-Data.Bits.popCount.patch (6.6 KB) - added by tibbe 8 years ago.

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by tibbe

comment:1 Changed 8 years ago by tibbe

Status: newpatch

comment:2 Changed 8 years ago by simonmar

Milestone: 7.4.1
Priority: normalhigh

comment:3 Changed 8 years ago by tibbe

Resolution: fixed
Status: patchclosed
Note: See TracTickets for help on using tickets.