<div dir="ltr">You could consider the 'linear' package [1]. Any type that is an instance of the Linear.V2.R2 class could be considered to be a point on a 2D plane.<div><br></div><div>Adding and subtracting vectors can be achieved using the Linear.Vector.Additive class.</div><div>Linear.Metric.Metric has dot product and length of vectors.</div><div>The Linear.Matrix module can be used for transformations. Combining transformations is just matrix multiplication. </div><div><br></div><div>I'm quite happy with the 'linear' package as a whole, but it could use more documentation showing simple operations. Its abstact nature can be a bit daunting.<br><div><br></div><div>1 - <a href="https://hackage.haskell.org/package/linear">https://hackage.haskell.org/package/linear</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-12 16:45 GMT+01:00 Christopher Howard <span dir="ltr"><<a href="mailto:ch.howard@zoho.com" target="_blank">ch.howard@zoho.com</a>></span>:<br><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. What I'd like to have for a program I am working on is a generic typeclass for objects that can be treated like points on a 2D plane, and a few simple transform functions (e.g., addition, rotation around an origin) which I could combine to make more complex transformations. Of course, it would be trivial to do this myself, but it seems like the sort of thing somebody would have thought of already. Does anybody know of a package providing this? (I didn't see an obvious one when searching with hoogle.)<span class=""><font color="#888888"><br>
</font></span></blockquote></div><br></div></div></div>