
27 Mar
2013
27 Mar
'13
8:22 a.m.
Hi Jamie,
I'm sorry, but I copied exact code and I'm still getting an error:
$:l tst.hs [1 of 1] Compiling Main ( tst.hs, interpreted ) Ok, modules loaded: Main. $let a = toJSObject [("A","a")] $a JSONObject {fromJSObject = [("A","a")]} $encode a "{\"A\":\"a\"}" $getJSObj a
<interactive>:428:10: Couldn't match expected type `JSValue' with actual type `JSObject [Char]' In the first argument of `getJSObj', namely `a' In the expression: getJSObj a In an equation for `it': it = getJSObj a $
'getJSObj' seems to extract a JSObject from a JSValue, but you are giving a JSObject to 'getJSObj'. Try this: getJSObj $ JSValue a Greetings, Daniel