diff options
Diffstat (limited to 'src/JavaScript.hs')
| -rw-r--r-- | src/JavaScript.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/JavaScript.hs b/src/JavaScript.hs index bc27818..81b3502 100644 --- a/src/JavaScript.hs +++ b/src/JavaScript.hs @@ -12,8 +12,8 @@ module JavaScript ( import GHC.Wasm.Prim -getElementById :: String -> IO JSVal -getElementById = js_document_getElementById . toJSString +getElementById :: String -> IO (Maybe JSVal) +getElementById = fmap nullToNothing . js_document_getElementById . toJSString foreign import javascript unsafe "document.getElementById($1)" js_document_getElementById :: JSString -> IO JSVal |