Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import qualified Data.Map as M
import Data.Monoid
data MMap k a = MMap (M.Map k a)
instance (Ord k, Monoid a) => Monoid (MMap k a) where
mempty = MMap M.empty
(MMap m1) `mappend` (MMap m2) = MMap (M.unionWith mappend m1 m2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.