Re: [Haskell-cafe] Monoids and newtypes

2009-01-27 Thread Derek Elkins
On Tue, 2009-01-27 at 08:51 -0800, Anish Muttreja wrote: On Thu, 22 Jan 2009 09:46:19 -0800, Derek Elkins derek.a.elk...@gmail.com wrote: The old wiki had an excellent page that has not been replicated either verbatim or in spirit in the new wiki.

Re: [Haskell-cafe] Monoids and newtypes

2009-01-22 Thread Derek Elkins
On Thu, 2009-01-22 at 16:11 +0100, Ketil Malde wrote: One wart that was briefly mentioned during the Great Monoid Naming Thread of 2009 is the need to wrap types in newtypes to provide multiple instances of the same class with different semantics -- the archetypical example being Integer as a

Re: [Haskell-cafe] Monoids and newtypes

2009-01-22 Thread David Menendez
On Thu, Jan 22, 2009 at 10:11 AM, Ketil Malde ke...@malde.org wrote: I was just wondering if not phantom types might serve here as an alternative way to go about that. Here's a small example illustrating it: ... *Monoids mconcat [1,2::Foo Additive] Foo 3 *Monoids mconcat [1,2::Foo