<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I&#8217;m attempting to learn Haskell by writing some orbital
mechanics code.&nbsp; I&#8217;d like to use vector and matrix arithmetic to
simplify it.&nbsp; The Haskell book I&#8217;ve got, Simon Thompson&#8217;s &#8220;Haskell:
The Craft of Functional Programming,&#8221; has one approach, which is to alias
a list of numbers to Vector, and a list of vectors to Matrix, and then define
functions to perform inner and outer products (dot/cross products) and so
forth.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>On http://haskell.org/hawiki/FunDeps another approach is
sketched out that looks far more appealing to me. This is to create Vector and
Matrix types that can use overloaded arithmetic operators. It uses functional
dependencies, and the resulting syntax looks a lot like what you can do using
C++ or Matlab.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I don&#8217;t know enough Haskell to finish out the code
that is started there, and I haven&#8217;t been able to find any vector/matrix
libraries for Haskell that look like this.&nbsp; I did find a port of a linear
algebra library (BLAS) to Haskell, but it looked like it did everything in
imperative style.&nbsp; Performance is not a major concern for me at this point
so I&#8217;d prefer to do things functionally.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Does anyone know what the best way to do vector/matrix
arithmetic in Haskell might be?&nbsp; I don&#8217;t need arbitrary dimension; all
my work will be confined to 2D and 3D space.</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks!</span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

</div>

</body>

</html>