haskell Semigroups, specialized containers and a general map/reduce framework