<div dir="ltr">Fair enough, it should just be a matter of writing a patch then. <div><br></div><div>The general resolution to adopt these sorts of "obvious" only-one-way-to-do-it instances is already in place.</div><div><br></div><div><a href="https://ghc.haskell.org/trac/ghc/ticket/8797">https://ghc.haskell.org/trac/ghc/ticket/8797</a></div><div><a href="https://mail.haskell.org/pipermail/libraries/2014-June/023229.html">https://mail.haskell.org/pipermail/libraries/2014-June/023229.html</a></div><div><a href="https://ghc.haskell.org/trac/ghc/ticket/9043#comment:23">https://ghc.haskell.org/trac/ghc/ticket/9043#comment:23</a></div><div><div><br></div><div>etc.</div><div><br></div><div>At some point during 7.12 we'll need to go through and do an audit to see which ones are still missing.</div><div><br></div><div><div><div>-Edward<br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 22, 2015 at 3:04 AM, Oleg Grenrus <span dir="ltr"><<a href="mailto:oleg.grenrus@iki.fi" target="_blank">oleg.grenrus@iki.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Based on <a href="http://git.haskell.org/ghc.git/blob/refs/heads/ghc-7.10:/libraries/base/Data/Monoid.hs" target="_blank">http://git.haskell.org/ghc.git/blob/refs/heads/ghc-7.10:/libraries/base/Data/Monoid.hs</a><div>only First and Last have Functor, Applicative and Monad; Foldable, Traversable and Data are missing.<div><div class="h5"><br><div><br><div><blockquote type="cite"><div>On 22 Feb 2015, at 09:56, Edward Kmett <<a href="mailto:ekmett@gmail.com" target="_blank">ekmett@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Many instances for data types in Data.Monoid have already been added in 7.10.<div><br></div><div>Are these still missing?</div><div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 21, 2015 at 10:34 AM, Oleg Grenrus <span dir="ltr"><<a href="mailto:oleg.grenrus@iki.fi" target="_blank">oleg.grenrus@iki.fi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I propose to add Functor, Applicative, Monad, Foldable, and Traversable and maybe even MonadFix instances to wrapper newtypes in the Data.Monoid module.<br>
The same way as in the semigroups package, e.g. <a href="https://hackage.haskell.org/package/semigroups-0.16.1/docs/Data-Semigroup.html#t:Min" target="_blank">https://hackage.haskell.org/package/semigroups-0.16.1/docs/Data-Semigroup.html#t:Min</a> <<a href="https://hackage.haskell.org/package/semigroups-0.16.1/docs/Data-Semigroup.html#t:Min" target="_blank">https://hackage.haskell.org/package/semigroups-0.16.1/docs/Data-Semigroup.html#t:Min</a>><br>
<br>
Basically:<br>
<br>
instance Functor Sum where<br>
  fmap f (Sum x) = Sum (f x)<br>
<br>
instance Foldable Sum where<br>
  foldMap f (Sum a) = f a<br>
<br>
instance Traversable Sum where<br>
  traverse f (Sum a) = Sum <$> f a<br>
<br>
instance Applicative Sum where<br>
  pure = Sum<br>
  a <* _ = a<br>
  _ *> a = a<br>
  Sum f <*> Sum x = Sum (f x)<br>
<br>
instance Monad Sum where<br>
  return = Sum<br>
  _ >> a = a<br>
  Sum a >>= f = f a<br>
<br>
instance MonadFix Sum where<br>
  mfix f = fix (f . getSum)<br>
<br>_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br></blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div>