<div><div dir="auto">Well said Andrew!</div></div><div dir="auto"><br></div><div dir="auto">There’s a second twist : last I checked our abs for complex numbers isn’t the Euclidean norm or any Lp norm ..</div><div dir="auto"><br></div><div dir="auto">We could define the Pth power of the lpNorm for any complex a I think. Though that’s a weaker operation. </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 28, 2020 at 7:11 AM Andrew Lelechenko <<a href="mailto:andrew.lelechenko@gmail.com">andrew.lelechenko@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 28 Jan 2020, Dannyu NDos wrote:<br>
<br>
> `abs` represents a norm, but its type is wrong<br>
<br>
There are two useful meanings of `abs`, which coincide for integers. One is a norm. Another one is to define `abs` as a mapping from a ring R to a factor ring R / U(R), where U(R) is a ring of units, and `signum` as a mapping from R to U(R) such that `abs a * signum a = a`.<br>
<br>
> This enables us to implement rings (Num) and fields (Fractional) without<br>
> concerning about norms. For example, Gaussian integers.<br>
<br>
For Gaussian integers I find convenient to define `signum z` with a codomain {1, i, -1, -I} (basically, to which quadrant does z belong?) and `abs z` with the first quadrant as a codomain.<br>
<br>
Best regards,<br>
Andrew<br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>