packages feed

snaplet-fay-0.3.1.1: example/snaplets/fay/src/Dom.hs

{-# LANGUAGE EmptyDataDecls    #-}

module Dom where

import FFI
import Prelude


data Element
data Global
data Document

addOnload :: Fay f -> Fay ()
addOnload = ffi "window.addEventListener(\"load\", %1)"

createElement :: String -> Fay Element
createElement = ffi "document.createElement(%1)"

setInterval :: Double -> Fay () -> Fay Double
setInterval = ffi "setInterval(%2, %1)"