patch applied (cabal-branches/cabal-1.4): base-1.0 does not have Data.Map.alter so use insertWith instead