title: Haskell Array.Accelerate - forkOS error
body: <p>Trying to plot the output of some <code>Data.Array.Accelerate</code> computations with <code>gnuplot</code> I encountered a strange problem. When run via the interpreter everything is fine, as is plotting straight Haskell data or just printing the Accelerate values, however trying to plot the Accelerate data fails. The error given is <code>forkOS_entry: interrupted</code>.</p>
  
  <p>I've since realised I should just be more UNIXy and do one thing (well) in each program. But I'm interested in finding out why this fails. I include a minimum code sample below.</p>
  
  <pre><code>import Prelude hiding (zip,zipWith)
  
  import Graphics.Gnuplot.Simple
  import Data.Array.Accelerate
  -- import Data.Array.Accelerate.Interpreter
  import Data.Array.Accelerate.CUDA
  
  f :: Vector Float -&gt; Vector Float -&gt; Acc (Vector Float)
  f xs ys = let xs' = use xs
                ys' = use ys
            in
               (zipWith (*) xs' ys')
  n=10::Int
  
  points = toList.run $ f (fromList (Z:.n) [1..10]) (fromList (Z:.n) [-5..4])
  
  main = plotList [] points
  </code></pre>
  
  <p><strong>update 2014/09/11</strong></p>
  
  <p>Based on <code>user2141650</code>'s suggestion (thanks!) changing the last line to</p>
  
  <pre><code>plotList [] $! points
  </code></pre>
  
  <p>fixes the problem. In fact it makes the plot actually appear, whereas without this the program would finish with or without error but would never actually display the plot. I suppose I'd accept this as an answer if it was written up, but it would still be nice to know what's going on.</p>
  
  <p>Possibly related:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/17554008/forkos-entry-interrupted-error-what-is-this">forkOS_entry: interrupted error: what is this?</a></li>
  </ul>
  
  <p>(By the way, please stop trying to edit for grammar. There isn't anything wrong with the question as is, I am a native speaker and write exactly what I mean. Thank you for your contribution though.)</p>