Created
April 9, 2014 11:18
-
-
Save pasberth/10256596 to your computer and use it in GitHub Desktop.
GHCJS FFI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE JavaScriptFFI #-} | |
| import GHCJS.Foreign | |
| import GHCJS.Types | |
| import Control.Applicative | |
| foreign import javascript unsafe "document.getElementById($1).innerHTML" js_unsafeGetElementById :: JSString -> IO JSString | |
| main = do | |
| str <- fromJSString <$> js_unsafeGetElementById (toJSString "hoge") | |
| putStrLn str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment