histogramLine :: Int -> Int -> (String, Int) -> String
histogramLine max_key_length max_count (key, count) = key ++ nchars " " ' ' (max_key_length - length key) ++
                          nchars "" '#' ((80 - max_key_length - 1) *
                                            count `div` max_count) where
  nchars str c n | n <= 0 = str -- Append n of c to str
                 | otherwise = nchars (c:str) c (n - 1)
histogramLine :: Int -> Int -> (String, Int) -> String
histogramLine max_key_length max_count (key, count) = key ++ nchars " " ' ' (max_key_length - length key) ++
                          nchars "" '#' ((80 - max_key_length - 1) *
                                            count `div` max_count) where
  nchars str c n | n <= 0 = str -- Append n of c to str
                 | otherwise = nchars (c:str) c (n - 1)
histogramLine max_key_length max_count (key, count) = key ++ nchars " " ' ' (max_key_length - length key) ++
                          nchars "" '#' ((80 - max_key_length - 1) *
                                            count `div` max_count) where
  nchars str c n | n <= 0 = str -- Append n of c to str
                 | otherwise = nchars (c:str) c (n - 1)