Opened 3 years ago

Closed 3 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 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 (1)

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

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by tibbe

comment:1 Changed 3 years ago by tibbe

  • Status changed from new to patch

comment:2 Changed 3 years ago by simonmar

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

comment:3 Changed 3 years ago by tibbe

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