on master help sign in
Fix histogram examples.
13c3e9aHarendra Kumar
examples/FileIOExamples.hs+1−1
@@ -48,7 +48,7 @@ llhisto src = print =<< (S.fold (FL.classify FL.length)
48 $ S.splitOnSuffix (== ord' '\n') FL.length
48 $ S.splitOnSuffix (== ord' '\n') FL.length
49 $ File.toBytes src)
49 $ File.toBytes src)
50 where
50 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)
52
52
53main :: IO ()
53main :: IO ()
54main = do
54main = do
examples/HandleIO.hs+1−1
@@ -61,7 +61,7 @@ llhisto src = print =<< (S.fold (FL.classify FL.length)
61 $ S.splitWithSuffix (== ord' '\n') FL.length
61 $ S.splitWithSuffix (== ord' '\n') FL.length
62 $ S.unfold FH.read src)
62 $ S.unfold FH.read src)
63 where
63 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)
65
65
66main :: IO ()
66main :: IO ()
67main = do
67main = do