Skip to content

Instantly share code, notes, and snippets.

@RudolfVonKrugstein
Created July 16, 2012 12:40
Show Gist options
  • Save RudolfVonKrugstein/3122467 to your computer and use it in GitHub Desktop.
Save RudolfVonKrugstein/3122467 to your computer and use it in GitHub Desktop.
haste foreign imports
foreign import ccall jsSetInterval :: Int -> Callback a -> IO ()
setInterval :: Int -> IO () -> IO ()
setInterval time cb =
  jsSetInterval time (mkCallback $! cb)
foreign import ccall jsSetOnKeyDown :: Callback a -> IO ()
foreign import ccall jsSetOnKeyUp :: Callback a -> IO ()
setOnKeyDown :: (Int -> IO ()) -> IO ()
setOnKeyDown cb =
  jsSetOnKeyDown (mkCallback $! cb)
setOnKeyUp :: (Int -> IO ()) -> IO ()
setOnKeyUp cb =
  jsSetOnKeyUp (mkCallback $! cb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment