histogram
import Data.Map as M histogram :: [a] -> M a Int histogram = M.fromListWith (+) . (`zip` repeat 1)