Skip to content

Instantly share code, notes, and snippets.

@matthewbauer
Created August 2, 2018 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewbauer/7d6363aae15aec469b7c6c1885e0ab6e to your computer and use it in GitHub Desktop.
Save matthewbauer/7d6363aae15aec469b7c6c1885e0ab6e to your computer and use it in GitHub Desktop.
-- Compile: ghcjs -O -fforce-recomp test.hs
import qualified Data.Text.IO as T
import qualified Data.Text as T
import GHCJS.Prim
foreign import javascript unsafe "alert($1);" alert :: JSVal -> IO ()
main = do
alert $ toJSString "hello1"
T.putStrLn $ T.pack "hello2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment