Population count: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: Tidied, applied Ormolu.) |
m (→{{header|Haskell}}: Legibility) |
||
Line 2,038: | Line 2,038: | ||
popCount = sum . unfoldr go |
popCount = sum . unfoldr go |
||
where |
where |
||
go |
go x |
||
⚫ | |||
( bool Nothing |
|||
| otherwise = Nothing |
|||
. swap |
|||
⚫ | |||
) |
|||
<*> (0 <) |
|||
--------------------------- TEST ------------------------- |
--------------------------- TEST ------------------------- |