!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None !"02346=K*Types which can be converted to or from a .Objects are maps from  to . Like Aeson, we're using a strict .Arrays are vectors of .UA sumtype covering all the primitive types which can appear in queries or responses.It is similar to the aeson 9 type, except that RethinkDB has a few more types (like )), which have a special encoding in JSON.We can't automatically derive  because  does not have an instance of  . See the eqTime' function for why we can compare times.7  . D(c) 2011, 2012 Bryan O'Sullivan (c) 2011 MailRank, Inc.Apache experimentalportableNone24!Generates both  and 0 instance declarations for the given data type.EThis is a convienience function which is equivalent to calling both " and $." Generates a . instance declaration for the given data type.#IGenerates a lambda expression which encodes the given data type as Datum.Helper function used by both " and #{. Generates code to generate the Datum encoding of a number of constructors. All constructors must be from the same type.If constructor is nullary.FGenerates code to generate the Datum encoding of a single constructor.$ Generates a . instance declaration for the given data type.%VGenerates a lambda expression which parses the Datum encoding of the given data type.Helper function used by both $ and %x. Generates code to parse the Datum encoding of a number of constructors. All constructors must be from the same type.CGenerates code to parse the Datum encoding of a single constructor.DGenerates code to parse the Datum encoding of an n-ary constructor."Boilerplate for top level splices. The given  must be from a type constructor. Furthermore, the type constructor must be either a data type or a newtype. Any other value will result in an exception.%Extracts the name from a constructor..Extracts the name from a type variable binder.<Makes a string literal expression from a constructor's name.>Creates a string literal expression from a record field label.The name of the outermost Value constructor.,!Encoding options.'Name of the type for which to generate  and  instances."Encoding options.)Name of the type for which to generate a  instance declaration.#Encoding options.Name of the type to encode.Encoding options.9Constructors for which to generate Datum generating code.$Encoding options.)Name of the type for which to generate a  instance declaration.%Encoding options.Name of the encoded type.2Name of the type to which the constructors belong.Encoding options6Constructors for which to generate Datum parsing code.2Name of the type to which the constructor belongs.Encoding options.5Constructor for which to generate Datum parsing code.0Left (valFieldName, objName) or Right valName2Name of the type to which the constructor belongs.structor name.structor arity.Function that generates the actual code. Will be applied to the type variable binders and constructors extracted from the given .Resulting value in the  uasi monad.Encoding options !"#$% !"$#%+!"#$%None !"02346=K$&Errors include a plain-text description which includes further details. The RethinkDB protocol also includes a backtrace which we currently don't parse.'Means the query failed at runtime. An example is if you add together two values from a table, but they turn out at runtime to be booleans rather than numbers.(sMeans the query failed during parsing or type checking. For example, if you pass too many arguments to a function.)Means the client is buggy. An example is if the client sends a malformed protobuf, or tries to send [CONTINUE] for an unknown token.*An error on the protocol level. Perhaps the socket was closed unexpectedly, or the server sent a message which the driver could not parse.zA token is used to refer to queries and the corresponding responses. This driver uses a monotonically increasing counter.+&A value which can be converted from a . All types which are defined as being a 'Result a' should have a 'FromResponse a'. Because, uhm.. you really want to be able to extract the result from the response.There are two parsers defined here, one for atoms and the other for sequences. These are the only two implementations of parseResponse which should be used.,The result of a query. It is either an error or a result (which depends on the type of the query expression). This type is named to be symmetrical to 1, so we get this nice type for run. $run :: Handle -> Exp a -> IO (Res a)-=The type of result you get when executing a query of 'Exp a'..tBecause the arguments to functions are polymorphic (the individual arguments can, and often have, different types).fThe class of types e which can be lifted into c. All basic Haskell types which can be represented as 1R are instances of this, as well as certain types of functions (unary and binary).1Type-level function which simplifies the type of e once it is lifted into ca. This is used for functions where we strip the signature so that we don't have to define dummy  instances for those.jSequences are a bounded list of items. The server may split the sequence into multiple chunks when sending it to the client. When the response is a partial sequence, the client may request additional chunks until it gets a .kUsed in A.nConflictResolutionStrategy!How conflicts should be resolved.o?Update fields of the old document with fields from the new one.p:Replace the old document in its entirety with the new one.qYDo not insert the new document and record the conflict as an error. This is the default.rBounds are used in C.uA u? is something which contains tables. It is a server-only type.vv( is essentially a 'Maybe Object', where  is represented with  in the network protocol.w1Tables are something you can select objects from.qThis type is not exported, and merely serves as a sort of phantom type. On the client tables are converted to a j.xObjects are maps from  to . Like Aeson, we're using .lBuilding a RethinkDB query from an expression is a stateful process, and is done using this as the context. How many >s have been allocated. See .+The default database for the case that the w! expression doesn't specify one.A Term is a JSON expression which can be sent to the server. Building a term is a stateful operation, so the whole process happens inside a  monad.*Allocate a new var index from the context.z/Call an unary function with the given argument.{1Call an binary function with the given arguments..Convenience to for automatically converting a  to a constant expression.0Time in RethinkDB is represented similar to the b type. Except that the JSON representation on the wire looks different from the default used by Aeson. Therefore we have a custom FromRSON and ToRSON instances.Arrays are vectors of .%For strings, we're using the Haskell  type. Numbers are  (unlike Aeson , which uses  Scientific). No particular reason.7For a boolean type, we're reusing the standard Haskell  type.&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG~&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|  f&*)('+,-./017hgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:98765432ijkmlnqportsuvwxyz{|      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGNoneHiReceive the next message from the socket. If it fails, a (hopefully) descriptive error will be returned.IJKHLMNOIJKHLMNOIJKHLMNONone3 P+The database which should be used when the w! expression doesn't specify one.~CThe default port where RethinkDB accepts client driver connections.,Create a new handle to the RethinkDB server.?Close the given handle. You MUST NOT use the handle after this.VStart a new query and wait for its (first) result. If the result is an single value (v), then three will be no further results. If it is a sequence, then you must consume results until the sequence ends.NCollect all the values in a sequence and make them available as a 'Vector a'.QStart a new query. Returns the * which can be used to track its progress.RYLet the server know that it can send the next response corresponding to the given token.Stop (abort?) a query.8Wait until a previous query (which was started with the noreply option) finishes.gGet the next chunk of a sequence. It is an error to request the next chunk if the sequence is already ,}STUP~VWQXRYr &'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~r}~&*)(' 1hgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:98765432./rtskmljwuv,-+nqpo|0z{yxi}STUP~VWQXRYZ      !"#$%&'()*+,-./0123345+6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw_x^yz{|}~\   x    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]~^_`abcdrethinkdb-client-driver-0.0.13Database.RethinkDB.THDatabase.RethinkDBDatabase.RethinkDB.Types.DatumDatabase.RethinkDB.TypesDatabase.RethinkDB.Messages aeson-0.8.0.2Data.Aeson.Types.InternaldefaultTaggedObjectdefaultOptions sumEncodingomitNothingFieldsallNullaryToStringTagconstructorTagModifierfieldLabelModifierOptionscontentsFieldName tagFieldName TaggedObjectObjectWithSingleField TwoElemArray SumEncoding FromDatum parseDatumToDatumtoDatumObjectArrayDatumTimeStringNumberBoolNull.=.:.:?object deriveDatum deriveToDatum mkToDatumderiveFromDatum mkParseDatumError RuntimeError CompileError ClientError ProtocolError FromResponseResResultSomeExpliftExpDefaultInfo RandomFloat RandomIntegerTimezoneNowUUIDNthLimitCallFunctionVarKeysOrderByIndexedOrderByBetweenIndexedBetweenMapFilterInsertSequence InsertObjectDeleteIsEmptyPrependAppendTake HasFieldsGetFieldAnyAllMultiplyAdd GetAllIndexedGetAllGetMatchNotNeEqCoerceTableDatabase WaitIndex IndexStatus DropIndex CreateIndex ListIndices DropTable CreateTable ListTables DropDatabaseCreateDatabase ListDatabasesConstant IsSequenceSequenceOrder Descending AscendingConflictResolutionStrategyCRUpdate CRReplaceCRErrorBoundClosedOpenSingleSelectionIsObjectIsDatumcall1call2 emptyOptionsHandle defaultPort newHandlecloseruncollectstopwait nextChunk text-1.2.0.4Data.Text.InternalTextunordered-containers-0.2.5.1Data.HashMap.BaseHashMapValue $fEqDatumghc-prim GHC.Classes time-1.4.2Data.Time.LocalTime.LocalTime ZonedTime parseWirezonedTimeParser$fFromDatumValue$fToDatumValue$fFromDatumMaybe$fToDatumMaybe $fFromDatum[] $fToDatum[]$fFromDatumUTCTime$fToDatumUTCTime$fFromDatumZonedTime$fToDatumZonedTime$fFromDatumHashMap$fToDatumHashMap$fFromDatumVector$fToDatumVector$fFromDatumText $fToDatumText$fFromDatumInt $fToDatumInt$fFromDatumFloat$fToDatumFloat$fFromDatumDouble$fToDatumDouble$fFromDatumBool $fToDatumBool$fFromDatum(,,) $fToDatum(,,)$fFromDatum(,) $fToDatum(,) $fFromDatum() $fToDatum()$fFromDatumDatum$fToDatumDatum$fFromJSONDatum $fToJSONDatum consToDatum isNullary encodeArgs consFromDatum parseArgs parseProductwithTypetemplate-haskellLanguage.Haskell.TH.SyntaxName getConNametvbName conNameExp fieldLabelExp valueConName LookupField lookupFieldconStrconTxt conStringE encodeSumparseNullaryMatchesparseUnaryMatches parseRecord getValFieldCon matchFailedparseTypeMismatchunknownFieldFail noArrayFail noObjectFailfirstElemNoStringFailwrongPairCountFail noStringFail noMatchFail not2ElemArrayconNotFoundFail2ElemArray conNotFoundFailObjectSingleFieldconNotFoundFailTaggedObjectparseTypeMismatch'QapplyCon$fLookupFieldMaybe$fLookupFieldaTokenResponseLift SimplifiedTermDonebase Data.MaybeNothingContext varCounternewVardefaultDatabasetransformers-0.4.2.0Control.Monad.Trans.State.LazyState $fIsStringExp$fIsDatumZonedTime$fIsDatumVector $fIsDatumText$fIsDatumDouble GHC.TypesDouble $fIsDatumBool responseToken responseTyperesponseResult ResponseTypeRuntimeErrorTypeCompileErrorTypeClientErrorType WaitComplete SuccessFeedSuccessPartialSuccessSequence SuccessAtom parseResponsePartial MkDatabaseMkTabletoTerm compileTerm boundDatum boundString noargTerm simpleTermtermWithOptionsresponseAtomParserresponseSequenceParserresponseParser$fFromJSONResponseTypeTFCo:R:ResultSequenceTFCo:R:ResultSingleSelectionTFCo:R:ResultVectorTFCo:R:ResultHashMapTFCo:R:ResultDatumTFCo:R:ResultTableTFCo:R:ResultZonedTimeTFCo:R:ResultBoolTFCo:R:ResultIntTFCo:R:ResultDoubleTFCo:R:ResultText $fTermSomeExp $fLiftExp(->)$fLiftExp(->)0$fLiftExpVector$fLiftExpUTCTime$fLiftExpZonedTime$fLiftExpDatum$fLiftExpHashMap $fLiftExpText$fLiftExpDouble $fLiftExpInt $fLiftExpBool$fNumExp $fTermExp$fFromDatumSequence$fIsSequenceSequence$fFromResponseSequence$fShowSequence $fTermOrder#$fToDatumConflictResolutionStrategy$fIsObjectSingleSelection$fIsDatumSingleSelection$fIsSequenceTable $fTermUTCTime$fFromResponseUTCTime$fIsObjectUTCTime$fIsDatumUTCTime$fTermZonedTime$fFromResponseZonedTime$fIsObjectZonedTime $fTermHashMap$fFromResponseHashMap$fIsObjectHashMap$fIsDatumHashMap $fTermVector$fFromResponseVector$fIsSequenceVector $fTermText$fFromResponseText$fFromResponseInt $fTermDouble$fFromResponseDouble $fTermBool$fFromResponseBool$fFromResponseMaybe$fFromResponseDatum $fTermDatum$fIsDatumDatum $fTermValue recvMessage createSocket closeSocket sendMessagehandshakeMessagehandshakeReplyParser queryMessageresponseMessageParser hDatabasestartcontinuehSocket hTokenRef parseMessagemkErrorsingleElementArray getResponse