Skip to content

Instantly share code, notes, and snippets.

ghci> runCouchDB' $ getDoc (db "test") (doc "8e9112011580882422393f6291000f7d") :: IO (Maybe (Doc, JSValue))
*** Exception: user error (internal error: error parsing: {"_id":"8e9112011580882422393f6291000f7d","_rev":"1-967a00dff5e02add41819138abb3284d"})
ghci> runCouchDB' $ getAllDocs (db "test") [("include_docs", JSBool True)] :: IO [(Doc, JSValue)]
[(8e9112011580882422393f6291000f7d,*** Exception: toRowDoc: row does not have a value in [("id",JSString (JSONString {fromJSString = "8e9112011580882422393f6291000f7d"})),("key",JSString (JSONString {fromJSString = "8e9112011580882422393f6291000f7d"})),("value",JSObject (JSONObject {fromJSObject = [("rev",JSString (JSONString {fromJSString = "1-967a00dff5e02add41819138abb3284d"}))]}))]