Hi all,
I have the following problem, when trying to run the following code:
import GHC.Generics
import Haste
import Haste.Foreign
data Message = Skip | Tick { tick::Int }
deriving (Show, Generic,ToAny, FromAny)
main = fr (to 5) >>= writeLog . show
where
to n = toAny (Tick n)
fr :: JSAny -> IO Message
fr = fromAny
results in this error:
Uncaught TypeError: Cannot read property 'tick' of undefined
Seems like something goes wrong in the encoding. Any pointers or work arounds appreciated.
kind regards,
Maarten