Histogram in Haskell [closed]

We can start by generating ranges required, and then map count function onto ranges to get list of partial functions, which finally can be applied on the given list. ranges lim n = takeWhile (\(x,y) -> x < lim) [(k*n, (k+1)*n – 1) | k <- [0..]] count (l,r) = length.filter (\x -> l <= … Read more