Opened 5 years ago

Closed 5 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 5 years ago.

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by tibbe

comment:1 Changed 5 years ago by tibbe

  • Status changed from new to patch

comment:2 Changed 5 years ago by simonmar

  • Milestone set to 7.4.1
  • Priority changed from normal to high

comment:3 Changed 5 years ago by tibbe

  • Resolution set to fixed
  • Status changed from patch to closed
Note: See TracTickets for help on using tickets.