greskell-core-0.1.2.1: Haskell binding for Gremlin graph query language - core data types and tools

MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Greskell.GraphSON.GValue

Contents

Description

This module is for advanced use. Most users should just use Data.Greskell.GraphSON.

This module defines GValue and exposes its deconstructors.

Since: 0.1.2.0

Synopsis

GValue type

newtype GValue Source #

An Aeson Value wrapped in GraphSON wrapper type. Basically this type is the Haskell representaiton of a GraphSON-encoded document.

This type is used to parse GraphSON documents. See also FromGraphSON class.

Since: 0.1.2.0

Constructors

GValue 

Instances

Eq GValue Source # 

Methods

(==) :: GValue -> GValue -> Bool #

(/=) :: GValue -> GValue -> Bool #

Show GValue Source # 
Generic GValue Source # 

Associated Types

type Rep GValue :: * -> * #

Methods

from :: GValue -> Rep GValue x #

to :: Rep GValue x -> GValue #

Hashable GValue Source # 

Methods

hashWithSalt :: Int -> GValue -> Int #

hash :: GValue -> Int #

ToJSON GValue Source #

Reconstruct Value from GValue. It preserves all GraphSON wrappers.

FromJSON GValue Source #

Parse GraphSON wrappers recursively in Value, making it into GValue.

FromGraphSON GValue Source # 
type Rep GValue Source # 
type Rep GValue = D1 * (MetaData "GValue" "Data.Greskell.GraphSON.GValue" "greskell-core-0.1.2.1-FYeBSfof15d2XMYaMpNNBY" True) (C1 * (MetaCons "GValue" PrefixI True) (S1 * (MetaSel (Just Symbol "unGValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (GraphSON GValueBody))))

data GValueBody Source #

GValue without the top-level GraphSON wrapper.

Since: 0.1.2.0

Instances

Eq GValueBody Source # 
Show GValueBody Source # 
Generic GValueBody Source # 

Associated Types

type Rep GValueBody :: * -> * #

Hashable GValueBody Source # 
ToJSON GValueBody Source # 
type Rep GValueBody Source # 

constructors

nonTypedGValue :: GValueBody -> GValue Source #

Create a GValue without "@type" field.

Since: 0.1.2.0

typedGValue' Source #

Arguments

:: Text

"@type" field.

-> GValueBody 
-> GValue 

Create a GValue with the given "@type" field.

Since: 0.1.2.0

deconstructors

In most cases, you should not use these deconstructors. That is because internal structure of GValue may vary depending on the Gremlin server instance and its serializer. You should instead use parsers based on FromGraphSON class, such as parseEither.

If you are implementing parsers for GraphSON objects described in Gremlin IO Reference (http://tinkerpop.apache.org/docs/current/dev/io/), you may use these descructors.

unwrapAll :: GValue -> Value Source #

Remove all GraphSON wrappers recursively from GValue.

Since: 0.1.2.0

unwrapOne :: GValue -> Value Source #

Remove the top-level GraphSON wrapper, but leave other wrappers as-is. The remaining wrappers are reconstructed by toJSON to make them into Value.

Since: 0.1.2.0

gValueBody :: GValue -> GValueBody Source #

Get the GValueBody from GValue.

Since: 0.1.2.0

gValueType :: GValue -> Maybe Text Source #

Get the gsonType field from GValue.

Since: 0.1.2.0