faylang / fay

A proper subset of Haskell that compiles to JavaScript
https://github.com/faylang/fay/wiki
BSD 3-Clause "New" or "Revised" License
1.28k stars 89 forks source link

Error when compiling module with "--strict" #440

Open lucch opened 8 years ago

lucch commented 8 years ago

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:

fay-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?

fay-curry