I was trying Fay and wrote the simple following program:
{-# LANGUAGE EmptyDataDecls #-}
module Hello where
main :: Fay ()
main = do
putStrLn "Hello Fay!"
After compiling with fay Hello.hs --strict Hello and loading the HTML in the browser, I get the following error:
When I remove the main function, the TypeError message goes way. Despite of that error, I noticed that it's still possible to call Fay functions from Javascript: I added the following functions to the Hello.hs file:
myAdd :: Int -> Int -> Int
myAdd x y = x + y
myAddCurried :: Int -> Int -> Int
myAddCurried = (+)
What is intriguing me is the output of myAddCurried. What does that mean? Am I doing something silly?
I was trying Fay and wrote the simple following program:
After compiling with
fay Hello.hs --strict Hello
and loading the HTML in the browser, I get the following error:When I remove the
main
function, theTypeError
message goes way. Despite of that error, I noticed that it's still possible to call Fay functions from Javascript: I added the following functions to theHello.hs
file:What is intriguing me is the output of
myAddCurried
. What does that mean? Am I doing something silly?