Skip to content

Instantly share code, notes, and snippets.

@RudolfVonKrugstein
Created July 10, 2012 20:53
Show Gist options
  • Save RudolfVonKrugstein/3086169 to your computer and use it in GitHub Desktop.
Save RudolfVonKrugstein/3086169 to your computer and use it in GitHub Desktop.
Hello World with UHC javascript backend
type JSString = PackedString
foreign import prim "primStringToPackedString" toJS :: String -> JSString
data Document
foreign import js "document" getDocument :: IO Document
foreign import js "%1.write(%2)" write :: Document -> JSString -> IO ()
main = do
doc <- getDocument
write doc $ toJS "Hello, World!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment