ϊΞγώά³^      !"#$%&'()*+,-./0123456789:;<=>?@ABC D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] None NoneA reference to a property. O Implemented as a reference to an object and something to find the property. Object and property index. Object and property name.    None EQuasi quoter that creates a JavaScript string from JMacro expression & and stores it in a string litteral DQuasi quoter that creates a JavaScript string from JMacro statement & and stores it in a string litteral  ^ _   ^ _None The JSC. monad keeps track of the JavaScript context. Given a JSC function and a  you can run the  function like this...  * runReaderT jscFunction javaScriptContext 4For an example of how to set up WebKitGTK+ see tests/ TestJSC.hs Wrapped version of `# that runs in a MonadIO that works  a bit better with   CHandle JavaScriptCore functions that take a JSValueRefRef in order  to throw exceptions.     None5Catch JavaScript exceptions and rethrow Haskell ones aaNoneBAnything that can be used to make a JavaScript property reference @Anything that can be used to make a JavaScript object reference =Anything that can be used to make a list of JavaScript value , references for use as function arguments @Anything that can be used to make a JavaScript string reference ?Anything that can be used to make a JavaScript value reference    NonebcdefgbcdefgNone)Convert a JavaScript string to a Haskell h Convert a Haskell h to a JavaScript string i-If we already have a JSStringRef we are fine  jki   jkiNone&!RAn algebraic data type that can represent a JavaScript value. Any JavaScriptCore  " can be converted into this type. " an object # a string $ a number %true or false & undefined 'null -4Type that represents a value that can only be null. = Haskell of course has no null so we are adding this type. .0Given a JavaScript value get its boolean value. - All values in JavaScript convert to bool. testJSC $ valToBool JSNullfalsetestJSC $ valToBool ()falsetestJSC $ valToBool TruetruetestJSC $ valToBool Falsefalse#testJSC $ valToBool (1.0 :: Double)true#testJSC $ valToBool (0.0 :: Double)falsetestJSC $ valToBool ""falsetestJSC $ valToBool "1"true/0Given a JavaScript value get its numeric value.  May throw JSException. %testJSC $ show <$> valToNumber JSNull0.0!testJSC $ show <$> valToNumber ()NaN#testJSC $ show <$> valToNumber True1.0$testJSC $ show <$> valToNumber False0.0.testJSC $ show <$> valToNumber (1.0 :: Double)1.0.testJSC $ show <$> valToNumber (0.0 :: Double)0.0!testJSC $ show <$> valToNumber ""0.0"testJSC $ show <$> valToNumber "1"1.00HGiven a JavaScript value get its string value (as a JavaScript string).  May throw JSException. 'testJSC $ valToStr JSNull >>= strToTextnull#testJSC $ valToStr () >>= strToText undefined%testJSC $ valToStr True >>= strToTexttrue&testJSC $ valToStr False >>= strToTextfalse0testJSC $ valToStr (1.0 :: Double) >>= strToText10testJSC $ valToStr (0.0 :: Double) >>= strToText0#testJSC $ valToStr "" >>= strToText$testJSC $ valToStr "1" >>= strToText11<Given a JavaScript value get its string value (as a Haskell h).  May throw JSException. #testJSC $ show <$> valToText JSNull"null"testJSC $ show <$> valToText () "undefined"!testJSC $ show <$> valToText True"true""testJSC $ show <$> valToText False"false",testJSC $ show <$> valToText (1.0 :: Double)"1",testJSC $ show <$> valToText (0.0 :: Double)"0"testJSC $ show <$> valToText """" testJSC $ show <$> valToText "1""1"22Given a JavaScript value get a JSON string value.  May throw JSException. *testJSC $ valToJSON 0 JSNull >>= strToTextnull&testJSC $ valToJSON 0 () >>= strToText(testJSC $ valToJSON 0 True >>= strToTexttrue)testJSC $ valToJSON 0 False >>= strToTextfalse3testJSC $ valToJSON 0 (1.0 :: Double) >>= strToText13testJSC $ valToJSON 0 (0.0 :: Double) >>= strToText0&testJSC $ valToJSON 0 "" >>= strToText""'testJSC $ valToJSON 0 "1" >>= strToText"1"+testJSC $ obj >>= valToJSON 0 >>= strToText{}3/Given a JavaScript value get its object value.  May throw JSException. UtestJSC $ (valToObject JSNull >>= valToText) `catch` \ (JSException e) -> valToText e"TypeError: 'null' is not an objectQtestJSC $ (valToObject () >>= valToText) `catch` \ (JSException e) -> valToText e'TypeError: 'undefined' is not an objecttestJSC $ valToObject TruetruetestJSC $ valToObject Falsefalse%testJSC $ valToObject (1.0 :: Double)1%testJSC $ valToObject (0.0 :: Double)0testJSC $ valToObject ""testJSC $ valToObject "1"141Convert to a JavaScript value (just an alias for ) 5Make a null JavaScript value 6Make an  undefined JavaScript value 7 Make a JavaScript boolean value 8Make a JavaScript number 9Make a JavaScript string :Derefernce a value reference.  "testJSC $ show <$> deRefVal JSNullValNulltestJSC $ show <$> deRefVal () ValUndefined testJSC $ show <$> deRefVal True ValBool True!testJSC $ show <$> deRefVal False ValBool False+testJSC $ show <$> deRefVal (1.0 :: Double) ValNumber 1.0+testJSC $ show <$> deRefVal (0.0 :: Double) ValNumber 0.0testJSC $ show <$> deRefVal "" ValString ""testJSC $ show <$> deRefVal "1" ValString "1"0testJSC $ show <$> valToObject True >>= deRefValValObject 0x...;!Make a JavaScript value out of a ! ADT. testJSC $ valMakeRef ValNull"null"!testJSC $ valMakeRef ValUndefined "undefined"#testJSC $ valMakeRef (ValBool True)"true""testJSC $ valMakeRef (ValNumber 1)"1"/testJSC $ valMakeRef (ValString $ pack "Hello")"Hello"lBMakes an argument list with just a single JavaScript value from a ! ADT. m Makes a JavaScript value from a ! ADT. nMakes a JavaScript string o<Makes an argument list with just a single JavaScript string pMakes a JavaScript string q<Makes an argument list with just a single JavaScript number rMakes a JavaScript number sCMakes an argument list with just a single JavaScript boolean value t Make a JavaScript boolean value uGThis allows us to pass no arguments easily (altenative would be to use [] ::[JSValueRef]). v Makes an  undefined JavaScript value w*Makes an argument list with just a single null JavaScript value xMakes a null JavaScript value y3JSValueRef can be made by evaluating a function in   as long : as it returns something we can make into a JSValueRef. z5A single JSValueRef can be used as the argument list {,If we already have a JSValueRef we are fine ,!"#$%&'(7JavaScript strings can be represented with the Haskell h type. )&A number in JavaScript maps nicely to |. *"JavaScript boolean values map the } haskell type. +;A type that can only be undefined in JavaScript. Using () B because functions in JavaScript that have no return, impicitly  return undefined. ,-./01234'value to convert to a JavaScript value 56789:;~lmnopqrstuvwxyz{!"#$%&'()*+,-./0123456789:;,-+*)(!'&%$#"./0312456789:;%!'&%$#"()*+,-./0123456789:;~lmnopqrstuvwxyz{None <DGet a property value given the object and the name of the property. =EGet a property value given the object and the index of the property. >%Gets the value of a property given a . ?This version of >) is handy when you also need to perform. 7 another operation on the object the property is on. @DSet a property value given the object and the name of the property. AESet a property value given the object and the index of the property. B%Sets the value of a property given a . ;We can pass a property as the only paramter to a function. €"We can use a property as a value. $We can use a property as an object. ‚2JSPropRef can be made by evaluating a function in   as long 9 as it returns something we can make into a JSPropRef. ƒ+If we already have a JSPropRef we are fine < object to find the property on. name of the property. exception if one is raised. returns the property value. = object to find the property on. index of the property. exception if one is raised. returns the property value. >property reference. returns the property value. ?property reference. 'returns the object and property value. @object to set the property on. name of the property. "new value to set the property to. *property attributes to give the property. exception if one is raised. Aobject to find property on. index of the property. "new value to set the property to. exception if one is raised. Bproperty reference. "new value to set the property to. €‚ƒ  <=>?@AB  <=>?@AB <=>?@AB€‚ƒ None!C8Type used for Haskell functions called from JavaScript. D1Java script function applications have this type „AMake a JavaScript function object that wraps a Haskell function. EPLookup a property based on its name. This function just constructs a JSPropRef X the lookup is delayed until we use the JSPropRef. This makes it a bit lazy compared  to JavaScript's . operator. %testJSC $ eval "'Hello World'.length"&testJSC $ val "Hello World" ! "length"11FQLookup a property based on its index. This function just constructs a JSPropRef X the lookup is delayed until we use the JSPropRef. This makes it a bit lazy compared  to JavaScript's [] operator. !testJSC $ eval "'Hello World'[6]" testJSC $ val "Hello World" !! 6WG/Makes a getter for a particular property name.   js name = to (!name) %testJSC $ eval "'Hello World'.length"*testJSC $ val "Hello World" ^. js "length"11HHandy way to call a function  " jsf name = js name . to (# args) 6testJSC $ val "Hello World" ^. jsf "indexOf" ["World"]6I7Handy way to call a function that expects no arguments   js0 name = jsf name () 0testJSC $ val "Hello World" ^. js0 "toLowerCase" hello worldJ7Handy way to call a function that expects one argument   js1 name a0 = jsf name [a0] 4testJSC $ val "Hello World" ^. js1 "indexOf" "World"6K8Handy way to call a function that expects two arguments L:Handy way to call a function that expects three arguments M9Handy way to call a function that expects four arguments N9Handy way to call a function that expects five arguments O@Handy way to get and hold onto a reference top level javascript 2testJSC $ eval "w = console; w.log('Hello World')"@testJSC $ do w <- jsg "console"; w ^. js "log" # ["Hello World"]11PCall a JavaScript function /testJSC $ eval "'Hello World'.indexOf('World')"3testJSC $ val "Hello World" ! "indexOf" # ["World"]6QCall a JavaScript function )testJSC $ eval "var j = {}; j.x = 1; j.x"2testJSC $ do {j <- eval "({})"; j!"x" <# 1; j!"x"}1R+Use this to create a new JavaScript object !testJSC $ new "Date" (2013, 1, 1)(Fri Feb 01 2013 00:00:00 GMT+1300 (NZDT)SCall function with a given this . In most cases you should use '#'. >testJSC $ eval "(function(){return this;}).apply('Hello', [])"VtestJSC $ do { test <- eval "(function(){return this;})"; call test (val "Hello") () }HelloT2Make an empty object using the default constuctor /testJSC $ eval "var a = {}; a.x = 'Hello'; a.x">testJSC $ do { a <- obj; a ^. js "x" <# "Hello"; a ^. js "x" }HelloU Short hand ::JSCallAsFunction( so a haskell function can be passed to  a to a JavaScipt one. KtestJSC $ eval "(function(f) {f('Hello');})(function (a) {console.log(a)})"ŠtestJSC $ call (eval "(function(f) {f('Hello');})") global [fun $ \ _ _ args -> valToText (head args) >>= (liftIO . putStrLn . T.unpack) ]Hello undefinedW/Make an JavaScript array from a list of values &testJSC $ eval "['Hello', 'World'][1]"'testJSC $ array ["Hello", "World"] !! 1World4testJSC $ eval "['Hello', null, undefined, true, 1]"8testJSC $ array ("Hello", JSNull, (), True, 1.0::Double)Hello,,,true,1X JavaScript's global object …EGet an array containing the property names present on a given object †1Get the number of names in a property name array ‡(Get a name out of a property name array ˆ!Convert property array to a list YCGet a list containing the property names present on a given object ‰RGet a list containing references to all the properties present on a given object Z6Call a JavaScript object as function. Consider using '#'. [:Call a JavaScript object as a constructor. Consider using R. ŠKA callback to Haskell can be used as a JavaScript value. This will create 1 an anonymous JavaScript function object. Use V to create one with  a name. ‹4JSObjectRef can be made by evaluating a function in   as long ; as it returns something we can make into a JSObjectRef. Œ-If we already have a JSObjectRef we are fine $CFunction object this Function arguments Only + can be returned because - the function may need to be executed in a + different thread. If you need to get a - value out pass in a continuation function . as an argument and invoke it from haskell. D„EObject to look on Name of the property to find Property reference FObject to look on  Index of the property to lookup Property reference GName of the property to find HIJKLMNOPQProperty to set Value to set it to Reference to the property set RSTUVName of the function Haskell function to call /Returns a JavaScript function object that will * call the Haskell one when it is called WX…†‡ˆY‰Z[ŽŠ‹ŒCDEFGHIJKLMNOPQRSTUVWXYZ[EFGDHIJKLMNOQPRSTVUCWXYZ[$CD„EFGHIJKLMNOPQRSTUVWX…†‡ˆY‰Z[ŽŠ‹Œ None\7Evaluates a script (like eval in java script). Unlike ] this function lets you N specify a source URL and starting line number for beter error information. ‘testJSC $ (evaluateScript "\n\n{" global "FileName" 53 >>= valToText) `catch` \(JSException e) -> array (e,e!"sourceURL", e!"line") >>= valToText+SyntaxError: Expected token '}',FileName,55].Evaluates a script (like eval in java script) testJSC $ eval "1+1"2\JavaScript to evaluate 0The Line number of the first line of the script ]JavaScript to evaluate \]\]\] NoneZ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]    !""#$%&'()*+,-./0123456789:;;<=>?@ABCDEFGHIJKLMNOP Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j klmnop q r s t u vwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽŽ‘’“”•– — ˜ ™ š › œ  ž Ÿ   ‘’ jsc-0.1.1.0Language.Javascript.JSC.Types"Language.Javascript.JSC.PropertiesLanguage.Javascript.JSC.JMacroLanguage.Javascript.JSC.Monad!Language.Javascript.JSC.ExceptionLanguage.Javascript.JSC.ClassesLanguage.Javascript.JSC.StringLanguage.Javascript.JSC.ValueLanguage.Javascript.JSC.Object Language.Javascript.JSC.EvaluateLanguage.Javascript.JSC.PropRef!Language.Javascript.JSC.ArgumentsLanguage.Javascript.JSC"webkitgtk3-javascriptcore-0.12.5.11Graphics.UI.Gtk.WebKit.JavaScriptCore.JSObjectRefJSPropertyAttributes,Graphics.UI.Gtk.WebKit.JavaScriptCore.JSBase JSContextRef JSStringRefJSPropertyNameArrayRef JSValueRef JSObjectRef JSValueRefRefIndex JSPropRefJSPropIndexRefevalJMEevalJMJSCcatchcatchvalrunJSCrunJSC_ JSExceptionrethrow MakePropRef makePropRef MakeObjectRef makeObjectRef MakeArgRefs makeArgRefs MakeStringRef makeStringRef MakeValueRef makeValueRef strToText textToStrJSValue ValObject ValString ValNumberValBool ValUndefinedValNullJSStringJSNumberJSBool JSUndefinedJSNull valToBool valToNumbervalToStr valToText valToJSON valToObjectval valMakeNullvalMakeUndefined valMakeBool valMakeNumber valMakeStringdeRefVal valMakeRefobjGetPropertyByNameobjGetPropertyAtIndexobjGetPropertyobjGetProperty'objSetPropertyByNameobjSetPropertyAtIndexobjSetPropertyJSCallAsFunctionJSF!!!jsjsfjs0js1js2js3js4js5jsg#<#newcallobjfunfunctionarrayglobal propertyNamesobjCallAsFunctionobjCallAsConstructorevaluateScripteval quoteEvalJME quoteEvalJMbaseControl.Exception.Base$fExceptionJSException$fMakeArgRefs(,,,,)$fMakeArgRefs(,,,)$fMakeArgRefs(,,)$fMakeArgRefs(,)$fMakeArgRefs[]$fMakeArgRefsReaderT text-0.11.3.1Data.Text.InternalText$fMakeStringRefPtr$fMakeStringRef[]$fMakeStringRefText$fMakeArgRefsJSValue$fMakeValueRefJSValue$fMakeValueRef[]$fMakeArgRefsText$fMakeValueRefText$fMakeArgRefsDouble$fMakeValueRefDouble$fMakeArgRefsBool$fMakeValueRefBool$fMakeArgRefs()$fMakeValueRef()$fMakeArgRefsJSNull$fMakeValueRefJSNull$fMakeValueRefReaderT$fMakeArgRefsPtr$fMakeValueRefPtrghc-prim GHC.TypesDoubleBool$fMakeObjectRefJSNull$fMakeArgRefsJSPropRef$fMakeValueRefJSPropRef$fMakeObjectRefJSPropRef$fMakePropRefReaderT$fMakePropRefJSPropRef mkJSObjectCallAsFunctionCallbackcopyPropertyNamespropertyNamesCountpropertyNamesAtpropertyNamesList properties$fMakeValueRef(->)$fMakeObjectRefReaderT$fMakeObjectRefPtr makeArray$fMakeArgRefs(->)