title: Do these monoid instances exist somewhere already?
body: <p>"Somewhere" being "in the standard library or in some package that's small and general enough to make it a relatively harmless dependency".</p>
  
  <pre><code>import qualified Data.Map as M
  import Data.Monoid
  import Control.Applicative
  
  newtype MMap k v = MMap {unMMap :: M.Map k v}
  newtype MApplictive f a = MApplicative {unMApplicative :: f a}
  
  -- M.unionWith f M.empty m = M.unionWith f m M.empty = m
  -- f a (f b c) = f (f a b) c =&gt;
  --    M.unionWith f m1 (M.unionWith f m2 m3) =
  --    M.unionWith f (M.unionWith f m1 m2) m3 
  instance (Ord k, Monoid v) =&gt; Monoid (MMap k v) where
      mempty = MMap $ M.empty
      mappend m1 m2 = MMap $ M.unionWith mappend (unMMap m1) (unMMap m2)
  
  
  instance (Applicative f, Monoid a) =&gt; Monoid (MApplicative f a) where
      mempty = MApplicative $ pure mempty
      mappend f1 f2 = MApplicative $ liftA2 mappend (unMApplicative f1) (unMApplicative f2)
  </code></pre>
  
  <p>(These instances should satisfy the monoid laws - didn't bother to prove it for the applicative one though)</p>
  
  <p>I'm asking because I have some use for both of those and I don't like to redefine things that are already there.</p>