Ticket #5431 (closed feature request: fixed)

Opened 21 months ago

Last modified 21 months ago

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

0001-Add-Data.Bits.popCount.patch Download (6.6 KB) - added by tibbe 21 months ago.

Change History

Changed 21 months ago by tibbe

Changed 21 months ago by tibbe

  • status changed from new to patch

Changed 21 months ago by simonmar

  • priority changed from normal to high
  • milestone set to 7.4.1

Changed 21 months ago by tibbe

  • status changed from patch to closed
  • resolution set to fixed

I've pushed this as 7afc8f048b54d3a496585a9d2b674585ee3de495

Note: See TracTickets for help on using tickets.