title: Fay: how to show a value and use this string in JS?
body: <p>I'm mixing old JS and new Fay-generated JS, and I'm trying to get a string representation of some data from Fay. I defined</p>
  
  <pre><code>jshow :: Bool -&gt; String
  jshow d = show d
  </code></pre>
  
  <p>It's not just a <code>Bool</code> in the real code, but the type doesn't change the error.</p>
  
  <p>This is compiled with </p>
  
  <pre><code>fay Linguatron.hs --strict Linguatron
  </code></pre>
  
  <p>And then I call it in JS with</p>
  
  <pre><code>Strict.Linguatron.jshow(trainingData);
  </code></pre>
  
  <p>when <code>trainingData</code> is the result from another Fay function which I call from JS.</p>
  
  <p>This gives an error that <code>xs</code> is undefined, and this is inside the Fay standard code! It's on line 436, which looks like</p>
  
  <pre><code>// Make a list.
  function Fay$$list(xs){
    var out = null;
    for(var i=xs.length-1; i&gt;=0;i--)   //&lt;&lt;-- This line
      out = new Fay$$Cons(xs[i],out);
    return out;
  }
  </code></pre>
  
  <p>The full trace is</p>
  
  <pre><code>Fay$$list               @   linguatron.js:436
  Fay$$jsToFay_string     @   linguatron.js:281
  (anonymous function)    @   linguatron.js:822
  Fay$$$.force            @   linguatron.js:52
  Fay$$_                  @   linguatron.js:29
  (anonymous function)    @   linguatron.js:173
  (anonymous function)    @   main.js:56
  m.event.dispatch        @   jquery.js:4670
  r.handle                @   jquery.js:4338
  </code></pre>
  
  <p>I'm using Fey 0.23.1.12 and it happens on Chrome, Safari, and Firefox.</p>