Skip to content

Instantly share code, notes, and snippets.

@BookGin
Created May 8, 2018
Embed
What would you like to do?
histogram
histogram a = concat (map (++"\n") ([concat [if c!!j >= i then "*" else " " | j <- [0..9]] | i <- reverse [1..maximum c]] ++ ["==========", "0123456789"]))
where c = [length (filter (==i) a) | i <- [0..9]]
-- putStrLn d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment