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

Jason McCarty jmccarty at sent.com
Wed Oct 7 20:44:27 EDT 2009


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 sure if I could prove it via the axioms, I
> > think it's possible, but I don't recall the proof).
> 
> 0*x = (0+0)*x = 0*x + 0*x ==> 0*x = 0

This proof only works if your additive monoid is cancellative, which
need not be true in a semiring. The natural numbers extended with
infinity is one example (if you don't take 0*x = 0 as an axiom, I think
there are two possibilities for 0*∞).

-- 
Jason McCarty <jmccarty at sent.com>


More information about the Haskell-Cafe mailing list