<div dir="ltr"><div><div>On Tue, Mar 17, 2015 at 10:41 PM, Brent Yorgey <span dir="ltr"><<a href="mailto:byorgey@gmail.com" target="_blank">byorgey@gmail.com</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I have EXACTLY the same question.  We recently switched from vector-space to linear for diagrams.  There are quite a lot of reasons why this works really well for us.  But I was very sad to find that we can now add points, which indeed we do not want to be able to do.  At least there are still different types for points and vectors, which allows transformations like 'translate' to act on them differently, which I actually find to be much more critical from a correctness point of view.<div><br></div><div>I have had a brief explanation, but I forget the exact details.  Something about 'Additive' not really being about 'additive groups' but instead being a superclass of Applicative.  I remember being convinced at least that it's a "pick your poison" sort of choice, i.e. removing the Additive instance for Point would make certain other things ugly/annoying.  Hopefully someone else can chime in with more detail.</div><span><font color="#888888"><div><br></div></font></span></div></blockquote><div><br></div>The name Additive is a bit of a misnomer, like you said. The real reason it exists is to support matrix operations on both sparse/dense matrices.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Matrix multiplication looks like:<br><div><div><table style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2000007629395px"><tbody><tr><td style="padding:0px 10px;vertical-align:top;overflow:visible;word-wrap:normal"><br><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap">(!*!) :: (</span></font><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;color:rgb(0,134,179)">Functor</span><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> m, </span></font><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;color:rgb(0,134,179)">Foldable</span><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> t, </span></font><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;color:rgb(0,134,179)">Additive</span><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> t, </span></font><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;color:rgb(0,134,179)">Additive</span><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> n, </span></font><span style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap;color:rgb(0,134,179)">Num</span><font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"> a) => m (t a) -> t (n a) -> m (n a)</span></font> <font face="Consolas, Liberation Mono, Menlo, Courier, monospace"><span style="font-size:12px;white-space:pre-wrap"><br><br></span></font></td></tr></tbody></table></div></div><div>Without that instance you'd be unable to build matrices with Point's as one or both of the dimensions, which are intended to transform points.</div><div><br></div><div>If we can decide that that doesn't make sense (as after all points aren't additive), so such matrices _are_ kinda weird, we can remove the instance. </div><div><br></div><div>I'm happy to bend the way Point works, as I stick to the projective machinery almost exclusively, myself.</div><div><br></div><div>Thoughts?</div><div><br></div><div>-Edward </div><div><br></div><div>On Tue, Mar 17, 2015 at 5:47 PM Richard Eisenberg <<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi café,<br>
<br>
I'm in the middle of responding to <a href="https://github.com/goldfirere/units/pull/45" target="_blank">https://github.com/goldfirere/<u></u>units/pull/45</a> and trying to learn the `linear` package, which I have yet to use.<br>
<br>
I have what may be a basic question: why is there an `instance Additive f => Additive (Point f)` (in the Affine module)? It would seem that the whole point of Point is that it is *not* Additive. We don't want to add Points!<br>
<br>
Could someone enlighten me?<br>
<br>
Thanks!<br>
Richard<br>
<br>
PS: Of course, this instance is directly hurting my use of the package. But it is hurting my understanding of the package, because it disagrees with the mental model I've built up of the definitions.<br>
______________________________<u></u>_________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-<u></u>bin/mailman/listinfo/haskell-<u></u>cafe</a><br>
</blockquote></div></div></div></div></div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div></div>