histogram (a:as) = recurse 1 a as where
  recurse c x [] = [c]
  recurse c x (y:ys)
    | x == y    = recurse (c + 1) x ys
    | otherwise = c : recurse 1 y ys
histogram (a:as) = recurse 1 a as where
  recurse c x [] = [c]
  recurse c x (y:ys)
    | x == y    = recurse (c + 1) x ys
    | otherwise = c : recurse 1 y ys
histogram (a:as) = recurse 1 a as where
  recurse c x [] = [c]
  recurse c x (y:ys)
    | x == y    = recurse (c + 1) x ys
    | otherwise = c : recurse 1 y ys