I'm trying to wrap parts of the titanium api with PureScripts foreign function interface but I'm having trouble working out what the type definitions of the functions should be.
module Ti where
foreign import data Window :: *
foreign import window
""" function (config) {
return function () {
return Ti.UI.createWindow(config);
}
} """ :: ??? -> Window
foreign import open
""" function (window) {
return function () {
window.open();
return window;
}
} """ :: Window -> Window
main = do
w <- window ???
open w
import
withconfig
to create a function. Or is this supposed to be side-effecting? – elclanrs