Jump to content

Population count: Difference between revisions

m
m (→‎{{header|Haskell}}: Tidied, applied Ormolu.)
m (→‎{{header|Haskell}}: Legibility)
Line 2,038:
popCount = sum . unfoldr go
where
go =x
| 0 < x = (Just . flipswap) (quotRem x 2)
( bool Nothing
| otherwise = . JustNothing
. swap
. flip quotRem 2
)
<*> (0 <)
 
--------------------------- TEST -------------------------
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.