Hi all,<br><br>I&#39;m trying to go through the paper Beautiful Differentiation by Conal Elliott and got a bit stuck.  So I decided to download the VectorSpace package, which as far as I know implements the paper, and just try and play around with it.  Unfortunately when I tried the simple examples at the beginning of the paper I got an error:<br>
<br>Prelude Data.VectorSpace&gt; :m Data.Derivative<br>Prelude Data.Derivative&gt; let f1 z = sqrt(3*sin z)<br>Prelude Data.Derivative&gt; f1 (D 2 1)<br><br>Top level:<br>    Couldn&#39;t match expected type `Data.VectorSpace.Scalar a&#39;<br>
           against inferred type `Data.VectorSpace.Scalar<br>                                    (Data.VectorSpace.Scalar a)&#39;<br>      NB: `Data.VectorSpace.Scalar&#39; is a type function, and may not be injective<br>
<br>&lt;interactive&gt;:1:0:<br>    No instances for (Data.MemoTrie.HasTrie (Data.Basis.Basis a),<br>                      Floating (Data.VectorSpace.Scalar a),<br>                      Data.VectorSpace.VectorSpace (Data.VectorSpace.Scalar a))<br>
      arising from a use of `f1&#39; at &lt;interactive&gt;:1:0-9<br>    Possible fix:<br>      add an instance declaration for<br>      (Data.MemoTrie.HasTrie (Data.Basis.Basis a),<br>       Floating (Data.VectorSpace.Scalar a),<br>
       Data.VectorSpace.VectorSpace (Data.VectorSpace.Scalar a))<br>    In the expression: f1 (D 2 1)<br>    In the definition of `it&#39;: it = f1 (D 2 1)<br><br>&lt;interactive&gt;:1:8:<br>    No instance for (Num<br>                       (a Data.LinearMap.:-* (a :&gt; Data.VectorSpace.Scalar a)))<br>
      arising from the literal `1&#39; at &lt;interactive&gt;:1:8<br>    Possible fix:<br>      add an instance declaration for<br>      (Num (a Data.LinearMap.:-* (a :&gt; Data.VectorSpace.Scalar a)))<br>    In the second argument of `D&#39;, namely `1&#39;<br>
    In the first argument of `f1&#39;, namely `(D 2 1)&#39;<br>    In the expression: f1 (D 2 1)<br><br>Which was completely incomprehensible to me.  I tried looking at the documentation but I couldn&#39;t find anything about actually using the library.  Does anyone have any experience using this library and maybe have some examples of it&#39;s use?<br>
<br>Thanks<br><br>Chris Witte<br>