[Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-09 Thread Ben Franksen
Joe Fredette wrote: A ring is an abelian group in addition, with the added operation (*) being distributive over addition, and 0 annihilating under multiplication. (*) is also associative. Rings don't necessarily need _multiplicative_ id, only _additive_ id. Yes, this is how I learned it in

[Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Ben Franksen
Daniel Fischer wrote: Am Montag 05 Oktober 2009 16:29:02 schrieb Job Vranish: In what way is it not a number? If there's a natural[1] implementation of fromInteger, good. If there isn't, *don't provide one*. fromInteger _ = error Not sensible is better than doing something strange. [1]

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread David Menendez
On Wed, Oct 7, 2009 at 12:08 PM, Ben Franksen ben.frank...@online.de wrote: More generally, any ring with multiplicative unit (let's call it 'one') will do. Isn't that every ring? As I understand it, the multiplication in a ring is required to form a monoid. -- Dave Menendez

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Joe Fredette
A ring is an abelian group in addition, with the added operation (*) being distributive over addition, and 0 annihilating under multiplication. (*) is also associative. Rings don't necessarily need _multiplicative_ id, only _additive_ id. Sometimes Rings w/o ID is called a Rng (a bit of a

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Daniel Fischer
Am Mittwoch 07 Oktober 2009 22:44:19 schrieb Joe Fredette: A ring is an abelian group in addition, with the added operation (*) being distributive over addition, and 0 annihilating under multiplication. (*) is also associative. Rings don't necessarily need _multiplicative_ id, only _additive_

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Joe Fredette
I was just quoting from Hungerford's Undergraduate text, but yes, the default ring is in {Rng, Ring}, I haven't heard semirings used in the sense of a Rng. I generally find semirings defined as a ring structure without additive inverse and with 0-annihilation (which one has to assume in

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Daniel Fischer
Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette: I was just quoting from Hungerford's Undergraduate text, but yes, the default ring is in {Rng, Ring}, I haven't heard semirings used in the sense of a Rng. It's been looong ago, I seem to have misremembered :? But there used to be a

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Jason McCarty
Daniel Fischer wrote: Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette: I generally find semirings defined as a ring structure without additive inverse and with 0-annihilation (which one has to assume in the case of SRs, I included it in my previous definition because I wasn't

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Felipe Lessa
On Wed, Oct 07, 2009 at 08:44:27PM -0400, Jason McCarty wrote: Daniel Fischer wrote: Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette: I generally find semirings defined as a ring structure without additive inverse and with 0-annihilation (which one has to assume in the case

Re: [Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Daniel Fischer
Am Donnerstag 08 Oktober 2009 03:05:13 schrieb Felipe Lessa: On Wed, Oct 07, 2009 at 08:44:27PM -0400, Jason McCarty wrote: Daniel Fischer wrote: Am Mittwoch 07 Oktober 2009 23:51:54 schrieb Joe Fredette: I generally find semirings defined as a ring structure without additive inverse