How do I do multiline foreign imports in GHCJS? I have a block of javascript that stretches over multiple lines:
foreign import javascript unsafe
"{ var x = 41;\
\ $r = x + 1; \
\}"
answerToGreatestQuestion :: IO (JSRef Double)
And I get an error like:
lexical error in string/character literal at character 'i'
which points to the \
character. What's going on here?
If you're within a CPP block, remove the leading
\
from each line. See this issue.