-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Haskell client for Gremlin Server using WebSocket serializer
--   
--   Haskell client for <a>Gremlin Server</a> using WebSocket serializer.
--   See <a>README.md</a> for detail.
--   
--   This package is based on <a>greskell-core</a>, and best used with
--   <a>greskell</a> package.
@package greskell-websocket
@version 0.1.1.2


module Network.Greskell.WebSocket.Request.Common

-- | Class of operation objects.
class Operation o

-- | "processor" field.
opProcessor :: Operation o => o -> Text

-- | "op" field.
opName :: Operation o => o -> Text

-- | "args" field.
opArgs :: Operation o => o -> Object

-- | Possible SASL mechanisms.
data SASLMechanism

-- | "PLAIN" SASL
SASLPlain :: SASLMechanism

-- | "GSSAPI" SASL
SASLGSSAPI :: SASLMechanism

-- | A raw <a>ByteString</a> encoded to/decoded from a base64 text.
--   
--   <a>ToJSON</a> instance encodes the raw <a>ByteString</a> to a
--   base64-encoded <a>Text</a>. <a>FromJSON</a> is its inverse.
newtype Base64
Base64 :: ByteString -> Base64
[unByte64] :: Base64 -> ByteString
instance GHC.Classes.Ord Network.Greskell.WebSocket.Request.Common.Base64
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Common.Base64
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Common.Base64
instance GHC.Enum.Bounded Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance GHC.Enum.Enum Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance GHC.Classes.Ord Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Common.Base64
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Common.Base64
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Common.SASLMechanism
instance (Network.Greskell.WebSocket.Request.Common.Operation a, Network.Greskell.WebSocket.Request.Common.Operation b) => Network.Greskell.WebSocket.Request.Common.Operation (Data.Either.Either a b)


module Network.Greskell.WebSocket.Request

-- | RequestMessage to a Gremlin Server. See
--   <a>http://tinkerpop.apache.org/docs/current/dev/provider/</a>.
data RequestMessage
RequestMessage :: !UUID -> !Text -> !Text -> !Object -> RequestMessage
[$sel:requestId:RequestMessage] :: RequestMessage -> !UUID
[$sel:op:RequestMessage] :: RequestMessage -> !Text
[$sel:processor:RequestMessage] :: RequestMessage -> !Text
[$sel:args:RequestMessage] :: RequestMessage -> !Object

-- | Class of operation objects.
class Operation o

-- | "processor" field.
opProcessor :: Operation o => o -> Text

-- | "op" field.
opName :: Operation o => o -> Text

-- | "args" field.
opArgs :: Operation o => o -> Object

-- | Convert an <a>Operation</a> object to <a>RequestMessage</a>.
toRequestMessage :: Operation o => UUID -> o -> RequestMessage

-- | Create a <a>RequestMessage</a> from an <a>Operation</a> object. The
--   <a>$sel:requestId:RequestMessage</a> is generated by the random number
--   generator of the system.
makeRequestMessage :: Operation o => o -> IO RequestMessage
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.RequestMessage
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.RequestMessage
instance GHC.Show.Show Network.Greskell.WebSocket.Request.RequestMessage
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.RequestMessage
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.RequestMessage


module Network.Greskell.WebSocket.Request.Session
data OpAuthentication
OpAuthentication :: !(Maybe Int) -> !Base64 -> !SASLMechanism -> OpAuthentication
[$sel:batchSize:OpAuthentication] :: OpAuthentication -> !(Maybe Int)
[$sel:sasl:OpAuthentication] :: OpAuthentication -> !Base64
[$sel:saslMechanism:OpAuthentication] :: OpAuthentication -> !SASLMechanism
type SessionID = UUID
data OpEval
OpEval :: !(Maybe Int) -> !Text -> !(Maybe Object) -> !(Maybe Text) -> !(Maybe (HashMap Text Text)) -> !(Maybe Int) -> !SessionID -> !(Maybe Bool) -> OpEval
[$sel:batchSize:OpEval] :: OpEval -> !(Maybe Int)
[$sel:gremlin:OpEval] :: OpEval -> !Text
[$sel:bindings:OpEval] :: OpEval -> !(Maybe Object)
[$sel:language:OpEval] :: OpEval -> !(Maybe Text)
[$sel:aliases:OpEval] :: OpEval -> !(Maybe (HashMap Text Text))
[$sel:scriptEvaluationTimeout:OpEval] :: OpEval -> !(Maybe Int)
[$sel:session:OpEval] :: OpEval -> !SessionID
[$sel:manageTransaction:OpEval] :: OpEval -> !(Maybe Bool)
data OpClose
OpClose :: !(Maybe Int) -> !SessionID -> !(Maybe Bool) -> OpClose
[$sel:batchSize:OpClose] :: OpClose -> !(Maybe Int)
[$sel:session:OpClose] :: OpClose -> !SessionID
[$sel:force:OpClose] :: OpClose -> !(Maybe Bool)
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.Session.OpClose
instance GHC.Classes.Ord Network.Greskell.WebSocket.Request.Session.OpClose
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Session.OpClose
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Session.OpClose
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.Session.OpEval
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Session.OpEval
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Session.OpEval
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance GHC.Classes.Ord Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Session.OpClose
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Session.OpClose
instance Network.Greskell.WebSocket.Request.Common.Operation Network.Greskell.WebSocket.Request.Session.OpClose
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Session.OpEval
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Session.OpEval
instance Network.Greskell.WebSocket.Request.Common.Operation Network.Greskell.WebSocket.Request.Session.OpEval
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Session.OpAuthentication
instance Network.Greskell.WebSocket.Request.Common.Operation Network.Greskell.WebSocket.Request.Session.OpAuthentication


module Network.Greskell.WebSocket.Request.Standard
data OpAuthentication
OpAuthentication :: !(Maybe Int) -> !Base64 -> !SASLMechanism -> OpAuthentication
[$sel:batchSize:OpAuthentication] :: OpAuthentication -> !(Maybe Int)
[$sel:sasl:OpAuthentication] :: OpAuthentication -> !Base64
[$sel:saslMechanism:OpAuthentication] :: OpAuthentication -> !SASLMechanism
data OpEval
OpEval :: !(Maybe Int) -> !Text -> !(Maybe Object) -> !(Maybe Text) -> !(Maybe (HashMap Text Text)) -> !(Maybe Int) -> OpEval
[$sel:batchSize:OpEval] :: OpEval -> !(Maybe Int)
[$sel:gremlin:OpEval] :: OpEval -> !Text
[$sel:bindings:OpEval] :: OpEval -> !(Maybe Object)
[$sel:language:OpEval] :: OpEval -> !(Maybe Text)
[$sel:aliases:OpEval] :: OpEval -> !(Maybe (HashMap Text Text))
[$sel:scriptEvaluationTimeout:OpEval] :: OpEval -> !(Maybe Int)
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.Standard.OpEval
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Standard.OpEval
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Standard.OpEval
instance GHC.Generics.Generic Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance GHC.Classes.Ord Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance GHC.Classes.Eq Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance GHC.Show.Show Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Standard.OpEval
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Standard.OpEval
instance Network.Greskell.WebSocket.Request.Common.Operation Network.Greskell.WebSocket.Request.Standard.OpEval
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Request.Standard.OpAuthentication
instance Network.Greskell.WebSocket.Request.Common.Operation Network.Greskell.WebSocket.Request.Standard.OpAuthentication


module Network.Greskell.WebSocket.Response

-- | ResponseMessage object from Gremlin Server. See
--   <a>http://tinkerpop.apache.org/docs/current/dev/provider/</a>.
--   
--   Type <tt>s</tt> is the type of the response data.
data ResponseMessage s
ResponseMessage :: !UUID -> !ResponseStatus -> !(ResponseResult s) -> ResponseMessage s
[requestId] :: ResponseMessage s -> !UUID
[status] :: ResponseMessage s -> !ResponseStatus
[result] :: ResponseMessage s -> !(ResponseResult s)

-- | "status" field.
data ResponseStatus
ResponseStatus :: !ResponseCode -> !Text -> !Object -> ResponseStatus
[code] :: ResponseStatus -> !ResponseCode
[message] :: ResponseStatus -> !Text
[attributes] :: ResponseStatus -> !Object

-- | "result" field.
data ResponseResult s
ResponseResult :: !s -> !Object -> ResponseResult s

-- | "data" field.
[resultData] :: ResponseResult s -> !s
[meta] :: ResponseResult s -> !Object

-- | Response status code
data ResponseCode
Success :: ResponseCode
NoContent :: ResponseCode
PartialContent :: ResponseCode
Unauthorized :: ResponseCode
Authenticate :: ResponseCode
MalformedRequest :: ResponseCode
InvalidRequestArguments :: ResponseCode
ServerError :: ResponseCode
ScriptEvaluationError :: ResponseCode
ServerTimeout :: ResponseCode
ServerSerializationError :: ResponseCode
codeToInt :: ResponseCode -> Int
codeFromInt :: Int -> Maybe ResponseCode

-- | Returns <a>True</a> if the <a>ResponseCode</a> is a terminating code.
isTerminating :: ResponseCode -> Bool

-- | Returns <a>True</a> if the <a>ResponseCode</a> is a success.
--   
--   <pre>
--   &gt;&gt;&gt; isSuccess Success
--   True
--   
--   &gt;&gt;&gt; isSuccess Unauthorized
--   False
--   
--   &gt;&gt;&gt; isSuccess ServerError
--   False
--   </pre>
isSuccess :: ResponseCode -> Bool

-- | Returns <a>True</a> if the <a>ResponseCode</a> is a client-side
--   failure.
--   
--   <pre>
--   &gt;&gt;&gt; isClientSideError Success
--   False
--   
--   &gt;&gt;&gt; isClientSideError Unauthorized
--   True
--   
--   &gt;&gt;&gt; isClientSideError ServerError
--   False
--   </pre>
isClientSideError :: ResponseCode -> Bool

-- | Returns <a>True</a> if the <a>ResponseCode</a> is a server-side
--   failure.
--   
--   <pre>
--   &gt;&gt;&gt; isServerSideError Success
--   False
--   
--   &gt;&gt;&gt; isServerSideError Unauthorized
--   False
--   
--   &gt;&gt;&gt; isServerSideError ServerError
--   True
--   </pre>
isServerSideError :: ResponseCode -> Bool
instance GHC.Generics.Generic (Network.Greskell.WebSocket.Response.ResponseMessage s)
instance GHC.Classes.Eq s => GHC.Classes.Eq (Network.Greskell.WebSocket.Response.ResponseMessage s)
instance GHC.Show.Show s => GHC.Show.Show (Network.Greskell.WebSocket.Response.ResponseMessage s)
instance GHC.Generics.Generic (Network.Greskell.WebSocket.Response.ResponseResult s)
instance GHC.Classes.Eq s => GHC.Classes.Eq (Network.Greskell.WebSocket.Response.ResponseResult s)
instance GHC.Show.Show s => GHC.Show.Show (Network.Greskell.WebSocket.Response.ResponseResult s)
instance GHC.Generics.Generic Network.Greskell.WebSocket.Response.ResponseStatus
instance GHC.Classes.Eq Network.Greskell.WebSocket.Response.ResponseStatus
instance GHC.Show.Show Network.Greskell.WebSocket.Response.ResponseStatus
instance GHC.Enum.Bounded Network.Greskell.WebSocket.Response.ResponseCode
instance GHC.Enum.Enum Network.Greskell.WebSocket.Response.ResponseCode
instance GHC.Classes.Ord Network.Greskell.WebSocket.Response.ResponseCode
instance GHC.Classes.Eq Network.Greskell.WebSocket.Response.ResponseCode
instance GHC.Show.Show Network.Greskell.WebSocket.Response.ResponseCode
instance Data.Greskell.GraphSON.FromGraphSON s => Data.Aeson.Types.FromJSON.FromJSON (Network.Greskell.WebSocket.Response.ResponseMessage s)
instance Data.Greskell.GraphSON.FromGraphSON s => Data.Greskell.GraphSON.FromGraphSON (Network.Greskell.WebSocket.Response.ResponseMessage s)
instance GHC.Base.Functor Network.Greskell.WebSocket.Response.ResponseMessage
instance Data.Greskell.GraphSON.FromGraphSON s => Data.Aeson.Types.FromJSON.FromJSON (Network.Greskell.WebSocket.Response.ResponseResult s)
instance Data.Greskell.GraphSON.FromGraphSON s => Data.Greskell.GraphSON.FromGraphSON (Network.Greskell.WebSocket.Response.ResponseResult s)
instance GHC.Base.Functor Network.Greskell.WebSocket.Response.ResponseResult
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Response.ResponseStatus
instance Data.Greskell.GraphSON.FromGraphSON Network.Greskell.WebSocket.Response.ResponseStatus
instance Data.Aeson.Types.FromJSON.FromJSON Network.Greskell.WebSocket.Response.ResponseCode
instance Data.Greskell.GraphSON.FromGraphSON Network.Greskell.WebSocket.Response.ResponseCode
instance Data.Aeson.Types.ToJSON.ToJSON Network.Greskell.WebSocket.Response.ResponseCode


module Network.Greskell.WebSocket.Codec

-- | Encoder of <a>RequestMessage</a> and decoder of
--   <a>ResponseMessage</a>, associated with a MIME type.
--   
--   Type <tt>s</tt> is the body of Response.
data Codec s
Codec :: Text -> RequestMessage -> ByteString -> ByteString -> Either String (ResponseMessage s) -> Codec s

-- | MIME type sent to the server
[mimeType] :: Codec s -> Text

-- | Request encoder
[encodeWith] :: Codec s -> RequestMessage -> ByteString

-- | Response decoder
[decodeWith] :: Codec s -> ByteString -> Either String (ResponseMessage s)

-- | Encode a <a>RequestMessage</a> into a "binary" format of Gremlin
--   Server. The result includes the message "header" and the "payload".
encodeBinaryWith :: Codec s -> RequestMessage -> ByteString

-- | Make a request message header.
messageHeader :: Text -> ByteString

-- | Decode a message in the "binary" format. This is mainly for testing
--   purposes.
decodeBinary :: ByteString -> Either String (Text, ByteString)
instance GHC.Base.Functor Network.Greskell.WebSocket.Codec.Codec


module Network.Greskell.WebSocket.Codec.JSON

-- | Simple "application/json" codec.
--   
--   The encoder uses GraphSON v1 format. The decoder supports all GraphSON
--   v1, v2 and v3.
jsonCodec :: (FromGraphSON s) => Codec s


module Network.Greskell.WebSocket.Connection.Settings

-- | <a>Settings</a> for making connection to Gremlin Server.
--   
--   You can get the default <a>Settings</a> by <a>defSettings</a>
--   function, and customize its fields by accessor functions.
--   
--   Type <tt>s</tt> is the body of Response.
data Settings s
defSettings :: Codec s -> Settings s

-- | <a>defSettings</a> with <a>jsonCodec</a>.
defJSONSettings :: FromGraphSON s => Settings s

-- | codec for the connection.
codec :: Settings s -> (Codec s)

-- | Path of the WebSocket endpoint. Default: "/gremlin"
endpointPath :: Settings s -> String

-- | An exception handler for <a>GeneralException</a>. This exception is
--   not fatal, so the connection survives after this handler is called.
--   You don't have to re-throw the exception. Default: print the exception
--   to stderr.
onGeneralException :: Settings s -> (GeneralException -> IO ())

-- | Time out (in seconds) for responses. It is the maximum time for which
--   the connection waits for a response to complete after it sends a
--   request. If the response consists of more than one ResponseMessages,
--   the timeout applies to the last of the ResponseMessages. Default: 60
responseTimeout :: Settings s -> Int

-- | Maximum concurrent requests the connection can make to the server. If
--   the client tries to make more concurrent requests than this value,
--   later requests are queued in the connection or the client may be
--   blocked. Default: 4
concurrency :: Settings s -> Int

-- | Size of the internal queue of requests. Usually you don't need to
--   customize the field. See also <a>concurrency</a>. Default: 8.
requestQueueSize :: Settings s -> Int


module Network.Greskell.WebSocket.Connection

-- | Make a <a>Connection</a> to a Gremlin Server.
--   
--   If it fails to connect to the specified server, it throws an
--   exception.
connect :: Settings s -> Host -> Port -> IO (Connection s)

-- | Close the <a>Connection</a>.
--   
--   If there are pending requests in the <a>Connection</a>, <a>close</a>
--   function blocks for them to complete or time out.
--   
--   Calling <a>close</a> on a <a>Connection</a> already closed (or waiting
--   to close) does nothing.
close :: Connection s -> IO ()

-- | A WebSocket connection to a Gremlin Server.
--   
--   Type <tt>s</tt> is the body of Response, as in <a>ResponseMessage</a>.
data Connection s

-- | Host name or an IP address.
type Host = String

-- | TCP port number.
type Port = Int

-- | Make a <a>RequestMessage</a> from an <a>Operation</a> and send it.
--   
--   Usually this function does not throw any exception. Exceptions about
--   sending requests are reported when you operate on
--   <a>ResponseHandle</a>.
sendRequest :: Operation o => Connection s -> o -> IO (ResponseHandle s)

-- | Like <a>sendRequest</a>, but you can pass a <a>RequestMessage</a>
--   directly to this function.
sendRequest' :: Connection s -> RequestMessage -> IO (ResponseHandle s)

-- | A handle associated in a <a>Connection</a> for a pair of request and
--   response. You can retrieve <a>ResponseMessage</a>s from this object.
--   
--   Type <tt>s</tt> is the body of the response.
data ResponseHandle s

-- | Get a <a>ResponseMessage</a> from <a>ResponseHandle</a>. If you have
--   already got all responses, it returns <a>Nothing</a>. This function
--   may block for a new <a>ResponseMessage</a> to come.
--   
--   On error, it may throw all sorts of exceptions including
--   <a>RequestException</a>.
nextResponse :: ResponseHandle s -> IO (Maybe (ResponseMessage s))

-- | <a>STM</a> version of <a>nextResponse</a>.
nextResponseSTM :: ResponseHandle s -> STM (Maybe (ResponseMessage s))

-- | Get all remaining <a>ResponseMessage</a>s from <a>ResponseHandle</a>.
slurpResponses :: ResponseHandle s -> IO (Vector (ResponseMessage s))

-- | Similar to <a>slurpResponses</a>, but this function discards the
--   responses.
drainResponses :: ResponseHandle s -> IO ()

-- | Exception general to a <a>Connection</a>. It's not related to specific
--   requests.
data GeneralException

-- | Server sends a <a>ResponseMessage</a> with unknown requestId, which is
--   kept in this exception.
UnexpectedRequestId :: UUID -> GeneralException

-- | The <a>Connection</a> fails to parse a data from the server. The error
--   message is kept in this exception.
ResponseParseFailure :: String -> GeneralException

-- | An exception related to a specific request.
data RequestException

-- | The connection is already closed before it sends the request.
AlreadyClosed :: RequestException

-- | The server closed the connection before it sends response for this
--   request.
ServerClosed :: RequestException

-- | The requestId (kept in this object) is already pending in the
--   connection.
DuplicateRequestId :: UUID -> RequestException

-- | The server fails to send ResponseMessages within
--   <a>responseTimeout</a>.
ResponseTimeout :: RequestException


module Network.Greskell.WebSocket.Client.Options

-- | Configuration options to create a client for Gremlin Server.
--   
--   You can get the default <a>Options</a> by <a>defOptions</a> function,
--   and customize its fields by accessor functions.
data Options
defOptions :: Options

-- | Settings for the underlying <a>Connection</a>. Default:
--   <a>defJSONSettings</a>.
connectionSettings :: Options -> (Settings GValue)

-- | "batchSize" field for "eval" operation. Default: <a>Nothing</a>.
batchSize :: Options -> (Maybe Int)

-- | "language" field for "eval" operation. Default: <a>Nothing</a>.
language :: Options -> (Maybe Text)

-- | "aliases" field for "eval" operation. Default: <a>Nothing</a>.
aliases :: Options -> (Maybe (HashMap Text Text))

-- | "scriptEvaluationTimeout" field for "eval" operation. Default:
--   <a>Nothing</a>.
scriptEvaluationTimeout :: Options -> (Maybe Int)


module Network.Greskell.WebSocket.Client

-- | Create a <a>Client</a> to a Gremlin Server, with the default
--   <a>Options</a>.
connect :: Host -> Port -> IO Client

-- | Create a <a>Client</a> to a Gremlin Server.
connectWith :: Options -> Host -> Port -> IO Client

-- | Close the connection to the server and release other resources of the
--   <a>Client</a>.
close :: Client -> IO ()

-- | A client that establishes a connection to the Gremlin Server. You can
--   send Gremlin expression for evaluation by <a>submit</a> function.
data Client

-- | Host name or an IP address.
type Host = String

-- | TCP port number.
type Port = Int

-- | Submit a Gremlin script to the server. You can get its results by
--   <a>ResultHandle</a>. The result type <tt>v</tt> is determined by the
--   script type <tt>g</tt>.
--   
--   Usually this function does not throw any exception. Exceptions about
--   sending requests are reported when you operate on <a>ResultHandle</a>.
submit :: (ToGreskell g, r ~ GreskellReturn g, AsIterator r, v ~ IteratorItem r, FromGraphSON v) => Client -> g -> Maybe Object -> IO (ResultHandle v)

-- | Less type-safe version of <a>submit</a>.
submitRaw :: Client -> Text -> Maybe Object -> IO (ResultHandle GValue)

-- | A handle to receive the result of evaluation of a Gremlin script from
--   the server.
data ResultHandle v

-- | Get the next value from the <a>ResultHandle</a>. If you have got all
--   values, it returns <a>Nothing</a>. This function may block for a new
--   response to come.
--   
--   On error, it may throw all sorts of exceptions including
--   <a>SubmitException</a> and <a>RequestException</a>. For example, if
--   the submitted Gremlin script throws an exception, <a>nextResult</a>
--   throws <a>ResponseError</a> with <a>ResponseCode</a> of
--   <a>ScriptEvaluationError</a>.
nextResult :: ResultHandle v -> IO (Maybe v)

-- | <a>STM</a> version of <a>nextResult</a>.
nextResultSTM :: ResultHandle v -> STM (Maybe v)

-- | Get all remaining results from <a>ResultHandle</a>.
slurpResults :: ResultHandle v -> IO (Vector v)

-- | Similar to <a>slurpResults</a>, but this function discards the
--   results. Useful to execute a script whose side-effect is the only
--   thing you care.
drainResults :: ResultHandle v -> IO ()

-- | Exception about <a>submit</a> operation and getting its result.
data SubmitException

-- | The server returns a <a>ResponseMessage</a> with error
--   <a>ResponseCode</a>.
ResponseError :: (ResponseMessage GValue) -> SubmitException

-- | The client fails to parse the "data" field of the
--   <a>ResponseMessage</a>. The error message is kept in the <a>String</a>
--   field.
ParseError :: (ResponseMessage GValue) -> String -> SubmitException


module Network.Greskell.WebSocket
