jsaddle-0.3.0.3: High level interface for webkit-javascriptcore

Safe HaskellNone
LanguageHaskell2010

Language.Javascript.JSaddle.Monad

Contents

Description

JSM monad keeps track of the JavaScript context

Synopsis

Types

type JSM = ReaderT JSContextRef IO Source

The JSM monad keeps track of the JavaScript context.

Given a JSM function and a JSContextRef you can run the function like this...

runReaderT jsmFunction javaScriptContext

For an example of how to set up WebKitGTK+ see tests/TestJSaddle.hs

Running JSaddle given a DOM Window

Exception Handling

catchval :: (MutableJSArray -> JSM a) -> (JSVal -> JSM a) -> JSM a Source

Handle JavaScriptCore functions that take a MutableJSArray in order to throw exceptions.

catch :: (MonadIO m, Exception e) => ReaderT r IO b -> (e -> ReaderT r IO b) -> ReaderT r m b Source

Wrapped version of catch that runs in a MonadIO that works a bit better with JSM

bracket :: MonadIO m => ReaderT r IO a -> (a -> ReaderT r IO b) -> (a -> ReaderT r IO c) -> ReaderT r m c Source

Wrapped version of bracket that runs in a MonadIO that works a bit better with JSM

GUI thread support