[project @ 2005-10-25 09:11:25 by ross]
authorross <unknown>
Tue, 25 Oct 2005 09:11:25 +0000 (09:11 +0000)
committerross <unknown>
Tue, 25 Oct 2005 09:11:25 +0000 (09:11 +0000)
commitdbf490ac992de84156826d846b25ecfbc4346744
tree5af6f14cd042227fe841a2f30743f1f762a58d84
parentd86967d1e858adc01826bb7fa061996628dd5f97
[project @ 2005-10-25 09:11:25 by ross]
Change the Monoid instance for functions (as proposed on the libraries
list, and interpreting silence as assent) from composition to pointwise
combination.

Rationale: The new instance is consistent with the instances for tuples,
it's compositional, in that it builds instances for complex types out
of instances for simpler ones, and it makes this module Haskell 98.

Downside: the old instance was easy to use with Writer monads, and ShowS
was a special case.  You can get that effect using the new Endo type,
but you have to wrap and unwrap the newtype.

Also added a few other simple monoids: dual, sum and product.
Data/Monoid.hs