jsc-0.1.1.0: High level interface for webkit-javascriptcore

Safe HaskellNone

Language.Javascript.JSC.Monad

Contents

Description

JSC monad keeps track of the JavaScript context

Synopsis

Types

type JSC = ReaderT JSContextRef IOSource

The JSC monad keeps track of the JavaScript context.

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

 runReaderT jscFunction javaScriptContext

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

Running JSC given a DOM Window

runJSC :: WebView -> JSC a -> IO aSource

runJSC_ :: WebView -> JSC a -> IO ()Source

Exception Handling

catchval :: (JSValueRefRef -> JSC a) -> (JSValueRef -> JSC a) -> JSC aSource

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

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

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