We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app.on('certificate-error', callback)
I'm trying to find a good way to wrap https://github.com/electron/electron/blob/master/docs/api/app.md#event-certificate-error
newtype AppBlahCallback = AppBlahCallback JSVal foreign import javascript interruptible "app.on('blah', function (a, b, c, callback) { $c(a, b, c, callback); })" waitAppBlah :: IO (JSVal, JSVal, JSVal, AppBlahCallback) foreign import javascript unsafe "$1($2)" appBlahCallback :: AppBlahCallback -> Bool -> IO () main :: IO () main = do forkIO $ do (_, _, _, cb) <- waitAppBlah appBlahCallback cb True
I cannot retrieve IO (JSVal, JSVal, JSVal, AppBlahCallback) from waitAppBlah more than once, but the event can call the callback multiple times.
IO (JSVal, JSVal, JSVal, AppBlahCallback)
waitAppBlah
If I retrieved
from waitAppBlah twice,
app.on('blah', function (a, b, c, callback) { $c(a, b, c, callback); })
would just be called twice. This doesn't make sense.
Since no function on GHCJS/Foreign/Callback.hs generates a callback of 4 or more parameters, it's not possible to write the following snippet, either.
GHCJS/Foreign/Callback.hs
newtype AppBlahCallback = AppBlahCallback JSVal foreign import javascript unsafe "app.on('blah', $1)" onAppBlah :: Callback (JSVal -> JSVal -> JSVal -> AppBlahCallback -> IO ()) -> IO () foreign import javascript unsafe "$1($2)" appBlahCallback :: AppBlahCallback -> Bool -> IO () main :: IO () main = do onAppBlah $ asyncCallback4 $ \_ _ _ cb -> appBlahCallback cb True
Does ghcjs-base need modification before I become able to write a wrapper for https://github.com/electron/electron/blob/master/docs/api/app.md#event-certificate-error?
Perhaps, do we need the following functions?
syncCallbackN :: Int -> OnBlocked -> a -> IO (Callback a) asyncCallbackN :: Int -> a -> IO (Callback a)
Or, how about
asyncCallback :: (JSVal -> JSVal -> ... -> JSVal -> IO a) -> IO (Callback (JSVal -> JSVal -> ... -> JSVal -> IO a))
The text was updated successfully, but these errors were encountered:
I believe #76 subsumes this issue.
Sorry, something went wrong.
oops sorry did not see this and made #76 based on you gitter chat
No branches or pull requests
I'm trying to find a good way to wrap https://github.com/electron/electron/blob/master/docs/api/app.md#event-certificate-error
I cannot retrieve
IO (JSVal, JSVal, JSVal, AppBlahCallback)
fromwaitAppBlah
more than once, but the event can call the callback multiple times.If I retrieved
from
waitAppBlah
twice,would just be called twice. This doesn't make sense.
Since no function on
GHCJS/Foreign/Callback.hs
generates a callback of 4 or more parameters, it's not possible to write the following snippet, either.Does ghcjs-base need modification before I become able to write a wrapper for https://github.com/electron/electron/blob/master/docs/api/app.md#event-certificate-error?
Perhaps, do we need the following functions?
Or, how about
The text was updated successfully, but these errors were encountered: