<div dir="ltr">Hi Jack,<div><br></div><div>cd to the root directory of your project and </div><div>> cabal init</div><div><br></div><div>This will walk you through the usual fields and create .cabal file for you.</div><div><br></div><div>You can also look up any package on hackage and peek into its .cabal file</div><div><br></div><div>;)</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 August 2018 at 22:22, Jack Vice <span dir="ltr"><<a href="mailto:jack.vice@gmail.com" target="_blank">jack.vice@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I am attempting my first sandbox build with a cabal package (Chart) and I don't know what to put in my cabal.config file after looking at these sites:<div><a href="https://www.haskell.org/cabal/users-guide/developing-packages.html" target="_blank">https://www.haskell.org/cabal/<wbr>users-guide/developing-<wbr>packages.html</a><br></div><div><a href="http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html" target="_blank">http://coldwa.st/e/blog/2013-<wbr>08-20-Cabal-sandbox.html</a><br></div><div><a href="https://wiki.haskell.org/Cabal-Install" target="_blank">https://wiki.haskell.org/<wbr>Cabal-Install</a><br></div><div><br></div><div>I am getting the following build error:</div><div><div><b>Building chartHask-0.1.0.0...</b></div><div><b>Preprocessing executable 'chartHask' for chartHask-0.1.0.0...</b></div><div><b>[1 of 1] Compiling Main ( Main.hs, dist/build/chartHask/<wbr>chartHask-tmp/Main.o )</b></div><div><b><br></b></div><div><b>Main.hs:5:1: error:</b></div><div><b> Failed to load interface for ‘Graphics.Rendering.Chart.<wbr>Backend.Cairo’</b></div><div><b> Perhaps you meant</b></div><div><b> Graphics.Rendering.Chart.<wbr>Backend.Impl (from Chart-1.9)</b></div><div><b> Graphics.Rendering.Chart.<wbr>Backend.Types (from Chart-1.9)</b></div><div><b> Graphics.Rendering.Chart.<wbr>Backend (from Chart-1.9)</b></div><div><b> Use -v to see a list of the files searched for.</b></div></div><div><br></div><div>So, Maybe I'm dumb or it's not explicit (or both) on how to add a package to my cabal.config so it can find it and build. I tried adding this to my cabal.config to no avail:</div><div><div><b>documentation: True</b></div><div><b>constraints: Chart >= 1.9</b></div></div><div><br></div><div>Main.hs (from Chart example:</div><div><div><b>module Main where</b></div><div><b><br></b></div><div><b>import Graphics.Rendering.Chart.Easy</b></div><div><b>import Graphics.Rendering.Chart.<wbr>Backend.Cairo</b></div><div><b><br></b></div><div><b>signal :: [Double] -> [(Double,Double)]</b></div><div><b>signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x <- xs ]</b></div><div><b><br></b></div><div><b>main = toFile def "example1_big.png" $ do</b></div><div><b> layout_title .= "Amplitude Modulation"</b></div><div><b> setColors [opaque blue, opaque red]</b></div><div><b> plot (line "am" [signal [0,(0.5)..400]])</b></div><div><b> plot (points "am points" (signal [0,7..400]))</b></div></div><div><br></div><div>Or should I be using Stack? (probably private email or new thread question)</div><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>