title: How to call Haskell from Javascript with GHCJS
body: <p>I've been playing about with GHCJS. The FFI can be used to call javascript from Haskell but I can't figure out how do go the other way round. Say I had a super useful utility function I wrote in Haskell:</p>
  
  <pre><code>sayHello :: String -&gt; IO ()
  sayHello name = print $ "hello, " ++ name
  </code></pre>
  
  <p>Is it possible do something so I could call it from Javascript? The closest I've got is noticing that <code>h$main(h$main2CMainzimain)</code> will trigger my Haskell main function.</p>