Binary digits: Difference between revisions

Content added Content deleted
(→‎{{header|Haskell}}: Added unfolding implementation)
(→‎{{header|Haskell}}: Oops, forgotten reverse)
Line 1,192:
 
-- Or even more efficient (due to fusion) and universal implementation
toBin2 = foldMap show . reverse . toBase 2
 
toBase base = unfoldr modDiv