jsc-0.1.0.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 IO

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

Exception Handling

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

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

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