Fix histogram examples.
commit13c3e9a84494d5ab2324717d2317dcc2ba613486
authorHarendra Kumar <harendra.kumar@gmail.com>
dateThu 14 Nov 2019, 03:48 (7 years ago)
parente000868
examples/FileIOExamples.hs+1−1
@@ -48,7 +48,7 @@ llhisto src = print =<< (S.fold (FL.classify FL.length)
4848 $ S.splitOnSuffix (== ord' '\n') FL.length
4949 $ File.toBytes src)
5050 where
51− bucket n = let i = n `div` 10 in if i > 9 then (9,n) else (i,n)
51+ bucket n = let i = n `mod` 10 in if i > 9 then (9,n) else (i,n)
5252
5353main :: IO ()
5454main = do
examples/HandleIO.hs+1−1
@@ -61,7 +61,7 @@ llhisto src = print =<< (S.fold (FL.classify FL.length)
6161 $ S.splitWithSuffix (== ord' '\n') FL.length
6262 $ S.unfold FH.read src)
6363 where
64− bucket n = let i = n `div` 10 in if i > 9 then (9,n) else (i,n)
64+ bucket n = let i = n `mod` 10 in if i > 9 then (9,n) else (i,n)
6565
6666main :: IO ()
6767main = do