[Haskell-cafe] adding the elements of two lists
cdsmith at gmail.com
Mon Mar 26 16:31:48 CEST 2012
Jerzy Karczmarczuk <jerzy.karczmarczuk at unicaen.fr> wrote:
> Le 26/03/2012 02:41, Chris Smith a écrit :
>> Of course there are rings for which it's possible to represent the
>> elements as lists. Nevertheless, there is definitely not one that
>> defines (+) = zipWith (+), as did the one I was responding to.
> The additive structure does not define a ring.
> The multiplication can be a Legion, all different.
I'm not sure I understand what you're saying there. If you were
asking about why there is no ring on [a] that defines (+) = zipWith
(+), then here's why. By that definition, you have [1,2,3] + [4,5] =
[5,7]. But also [1,2,42] + [4,5] = [5,7]. Addition by [4,5] is not
one-to-one, so [4,5] cannot be invertible.
More information about the Haskell-Cafe