Moduleghc-internal-10.0.0Haskell2010
GHC.Internal.JS.Foreign.Callback
- 2 types
- 13 values
- Packageghc-internal-10.0.0
- Exports15
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceCallback.hs
When you create a callback, the Haskell runtime stores a reference to the exported IO action or function. This means that all data referenced by the exported value stays in memory, even if nothing outside the Haskell runtime holds a reference to to callback. Use releaseCallback to free the reference. Subsequent calls from JavaScript to the callback will result in an exception.
asynchronous callbacks
4 declarationsMake a callback (JavaScript function) that runs the supplied IO action in an asynchronous thread when called. Call releaseCallback when done with the callback, freeing data referenced by the IO action.
synchronous callbacks
4 declarationssyncCallback Make a callback (JavaScript function) that runs the supplied IO action in a synchronous thread when called. Call releaseCallback when done with the callback, freeing memory referenced by the IO action.
syncCallback1 Make a callback (JavaScript function) that runs the supplied IO function in a synchronous thread when called. The callback takes one argument that it passes as a JSVal value to the Haskell function. Call releaseCallback when done with the callback, freeing data referenced by the function.
syncCallback2 Make a callback (JavaScript function) that runs the supplied IO function in a synchronous thread when called. The callback takes two arguments that it passes as JSVal values to the Haskell function. Call releaseCallback when done with the callback, freeing data referenced by the function.
syncCallback3 Make a callback (JavaScript function) that runs the supplied IO function in a synchronous thread when called. The callback takes three arguments that it passes as JSVal values to the Haskell function. Call releaseCallback when done with the callback, freeing data referenced by the function.
synchronous callbacks that return a value
4 declarationsMake a callback (JavaScript function) that runs the supplied IO action in a synchronous thread when called. Call releaseCallback when done with the callback, freeing memory referenced by the IO action.