gonito/fay/Home.hs
2015-08-20 22:33:38 +02:00

23 lines
553 B
Haskell

{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE OverloadedStrings #-}
module Home where
import FFIExample
import DOM
import Data.Text (fromString)
import qualified Data.Text as T
import Fay.Yesod
import Prelude
import SharedTypes
main :: Fay ()
main = do
input <- getElementById "fibindex"
result <- getElementById "fibresult"
onKeyUp input $ do
indexS <- getValue input
index <- parseInt indexS
call (GetFib index) $ setInnerHTML result . T.pack . show