
15 Dec
2012
15 Dec
'12
8:23 a.m.
Hey, I am trying to write FFI bindings for cocos2d-html5 (with haste). In cocos2d-x html5 one defines a main scene containing a "onEnter" functions which initilizes the scene. The application is then started with: var myApp = new cocos2dApp(MainScene); which calls "MainScene.onEnter" in the correct moment. Now I wonder what be the best way to map this to Haskell. I could define newScene :: IO () -> IO Scene which takes the onEnter functions as argument. I do not know, my haskell experience is not very well founded. What do think about this approach? Can you think of a more haskellish approach? Thank you! Nathan