jsc-0.1.1.1: High level interface for webkit-javascriptcore

Safe HaskellNone
LanguageHaskell2010

Language.Javascript.JSC.Monad

Contents

Description

JSC monad keeps track of the JavaScript context

Synopsis

Types

type JSC = ReaderT JSContextRef IO Source

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 a Source

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

Exception Handling

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

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 b Source

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