How does this deal with calling arbitrary JS code from Haskell? For example, how would I use jQuery from Haste? Looks like a cool project, but that's the first thing I want to know for X to JS compilers.
foreign import ccall square :: Int -> Int
And use --with-js to link against a JS file: // square.js
function square(x) {
return x * x;
}
Using jQuery would be an interesting challenge. I suppose you could just get the jQuery object and go nuts on it unsafely, or write typesafe(ish) wrapper functions to export. The “ccall” convention is also a bit disingenuous.Source: https://github.com/valderman/haste-compiler/blob/master/doc/...