greskell-core-1.0.0.1: Haskell binding for Gremlin graph query language - core data types and tools
MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Greskell.Greskell

Description

 
Synopsis

Type

data Greskell a Source #

Gremlin expression of type a.

Greskell is essentially just a piece of Gremlin script with a phantom type. The type a represents the type of data that the script is supposed to evaluate to.

Eq and Ord instances compare Gremlin scripts, NOT the values they evaluate to.

Instances

Instances details
Functor Greskell Source #

Unsafely convert the phantom type.

Instance details

Defined in Data.Greskell.Greskell

Methods

fmap :: (a -> b) -> Greskell a -> Greskell b #

(<$) :: a -> Greskell b -> Greskell a #

IsString a => IsString (Greskell a) Source #

Same as string except for the input and output type.

Instance details

Defined in Data.Greskell.Greskell

Methods

fromString :: String -> Greskell a #

IsString a => Monoid (Greskell a) Source #

Monoidal operations on Greskell assumes String operations in Gremlin. mempty is the empty String, and mappend is String concatenation.

Instance details

Defined in Data.Greskell.Greskell

Methods

mempty :: Greskell a #

mappend :: Greskell a -> Greskell a -> Greskell a #

mconcat :: [Greskell a] -> Greskell a #

IsString a => Semigroup (Greskell a) Source #

Semigroup operator <> on Greskell assumes String concatenation on Gremlin.

Instance details

Defined in Data.Greskell.Greskell

Methods

(<>) :: Greskell a -> Greskell a -> Greskell a #

sconcat :: NonEmpty (Greskell a) -> Greskell a #

stimes :: Integral b => b -> Greskell a -> Greskell a #

Num a => Num (Greskell a) Source #

Integer literals and numeric operation in Gremlin

Instance details

Defined in Data.Greskell.Greskell

Fractional a => Fractional (Greskell a) Source #

Floating-point number literals and numeric operation in Gremlin

Instance details

Defined in Data.Greskell.Greskell

Show (Greskell a) Source # 
Instance details

Defined in Data.Greskell.Greskell

Methods

showsPrec :: Int -> Greskell a -> ShowS #

show :: Greskell a -> String #

showList :: [Greskell a] -> ShowS #

Eq (Greskell a) Source # 
Instance details

Defined in Data.Greskell.Greskell

Methods

(==) :: Greskell a -> Greskell a -> Bool #

(/=) :: Greskell a -> Greskell a -> Bool #

Ord (Greskell a) Source # 
Instance details

Defined in Data.Greskell.Greskell

Methods

compare :: Greskell a -> Greskell a -> Ordering #

(<) :: Greskell a -> Greskell a -> Bool #

(<=) :: Greskell a -> Greskell a -> Bool #

(>) :: Greskell a -> Greskell a -> Bool #

(>=) :: Greskell a -> Greskell a -> Bool #

max :: Greskell a -> Greskell a -> Greskell a #

min :: Greskell a -> Greskell a -> Greskell a #

ToGreskell (Greskell a) Source #

It's just id.

Instance details

Defined in Data.Greskell.Greskell

Associated Types

type GreskellReturn (Greskell a) Source #

type GreskellReturn (Greskell a) Source # 
Instance details

Defined in Data.Greskell.Greskell

class ToGreskell a where Source #

Something that can convert to Greskell.

Associated Types

type GreskellReturn a Source #

type of return value by Greskell.

Instances

Instances details
ToGreskell (Greskell a) Source #

It's just id.

Instance details

Defined in Data.Greskell.Greskell

Associated Types

type GreskellReturn (Greskell a) Source #

Conversions

toGremlin :: ToGreskell a => a -> Text Source #

Create a readable Gremlin script from Greskell.

toGremlinLazy :: ToGreskell a => a -> Text Source #

Same as toGremlin except that this returns lazy Text.

Literals

Functions to create literals in Gremlin script. Use fromInteger, valueInt or gvalueInt to create integer literals. Use fromRational or number to create floating-point data literals.

string :: Text -> Greskell Text Source #

Create a String literal in Gremlin script. The content is automatically escaped.

true :: Greskell Bool Source #

Boolean true literal.

false :: Greskell Bool Source #

Boolean false literal.

list :: [Greskell a] -> Greskell [a] Source #

List literal.

single :: Greskell a -> Greskell [a] Source #

Make a list with a single object. Useful to prevent the Gremlin Server from automatically iterating the result object.

number :: Scientific -> Greskell Scientific Source #

Arbitrary precision number literal, like "123e8".

value :: Value -> Greskell Value Source #

Aeson Value literal.

Note that Number does not distinguish integers from floating-point numbers, so value function may format an integer as a floating-point number. To ensure formatting as integers, use valueInt.

valueInt :: Integral a => a -> Greskell Value Source #

Integer literal as Value type.

Since: 0.1.2.0

gvalue :: Value -> Greskell GValue Source #

Value literal as GValue type.

Since: 0.1.2.0

gvalueInt :: Integral a => a -> Greskell GValue Source #

Integer literal as GValue type.

Since: 0.1.2.0

Unsafe constructors

unsafeGreskell Source #

Arguments

:: Text

Gremlin script

-> Greskell a 

Unsafely create a Greskell of arbitrary type. The given Gremlin script is printed as-is.

unsafeGreskellLazy Source #

Arguments

:: Text

Gremlin script

-> Greskell a 

Same as unsafeGreskell, but it takes lazy Text.

unsafeFunCall Source #

Arguments

:: Text

function name

-> [Text]

arguments

-> Greskell a

return value of the function call

Unsafely create a Greskell that calls the given function with the given arguments.

unsafeMethodCall Source #

Arguments

:: Greskell a

target object

-> Text

method name

-> [Text]

arguments

-> Greskell b

return value of the method call

Unsafely create a Greskell that calls the given object method call with the given target and arguments.

Examples

examples :: [(Text, Text)] Source #

Examples of using this module. See the source. The fst of the output is the testee, while the snd is the expectation.