tshm
10/31/2014 - 1:45 AM

histogram

histogram

import Data.Map as M

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