-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell bindings for the neo4j "cypher" query language -- -- haskell-cypher makes it easy to send cypher commands to neo4j servers -- over their REST API. Additionally, it allows users to parse haskell -- datatypes from cypher queries. @package cypher @version 0.2 module Data.Default.TH deriveDefault :: Name -> Q [Dec] module Data.Aeson.TH.Smart -- | Generates both ToJSON and FromJSON instance declarations -- for the given data type. -- -- This is a convienience function which is equivalent to calling both -- deriveToJSON and deriveFromJSON. deriveJSON :: (String -> String) -> Name -> Q [Dec] -- | Generates a ToJSON instance declaration for the given data -- type. -- -- Example: -- --
-- data Foo = Foo Char Int -- $(deriveToJSON id ''Foo) ---- -- This will splice in the following code: -- --
-- instance ToJSON Foo where -- toJSON = -- value -> case value of -- Foo arg1 arg2 -> Array $ create $ do -- mv <- unsafeNew 2 -- unsafeWrite mv 0 (toJSON arg1) -- unsafeWrite mv 1 (toJSON arg2) -- return mv --deriveToJSON :: (String -> String) -> Name -> Q [Dec] -- | Generates a FromJSON instance declaration for the given data -- type. -- -- Example: -- --
-- data Foo = Foo Char Int -- $(deriveFromJSON id ''Foo) ---- -- This will splice in the following code: -- --
-- instance FromJSON Foo where -- parseJSON = -- value -> case value of -- Array arr -> -- if (V.length arr == 2) -- then Foo <$> parseJSON (arr unsafeIndex 0) -- <*> parseJSON (arr unsafeIndex 1) -- else fail "<error message>" -- other -> fail "<error message>" --deriveFromJSON :: (String -> String) -> Name -> Q [Dec] -- | Generates a lambda expression which encodes the given data type as -- JSON. -- -- Example: -- --
-- data Foo = Foo Int ---- --
-- encodeFoo :: Foo -> Value -- encodeFoo = $(mkToJSON id ''Foo) ---- -- This will splice in the following code: -- --
-- value -> case value of Foo arg1 -> toJSON arg1 --mkToJSON :: (String -> String) -> Name -> Q Exp -- | Generates a lambda expression which parses the JSON encoding of the -- given data type. -- -- Example: -- --
-- data Foo = Foo Int ---- --
-- parseFoo :: Value -> Parser Foo -- parseFoo = $(mkParseJSON id ''Foo) ---- -- This will splice in the following code: -- --
-- \value -> case value of arg -> Foo <$> parseJSON arg --mkParseJSON :: (String -> String) -> Name -> Q Exp module Database.Cypher.Lucene -- | Convert an object to a Lucene query encoded as an ByteString. luceneEncode :: ToJSON a => a -> ByteString module Database.Cypher -- | All interaction with Neo4j is done through the Cypher monad. Use -- cypher to add a query to the monad. data Cypher a -- | A neo4j node or edge data Entity a -- | Raw result data returned by Neo4j. Only use this if you care about -- column headers. data CypherResult a CypherResult :: [Text] -> a -> CypherResult a rescolumns :: CypherResult a -> [Text] resdata :: CypherResult a -> a -- | Execute some number of cypher queries runCypher :: Cypher a -> Hostname -> Port -> IO a -- | Perform a cypher query cypher :: FromCypher a => Text -> Value -> Cypher a -- | An error in handling a Cypher query, either in communicating with the -- server or parsing the result data CypherException CypherServerException :: Status -> ResponseHeaders -> ByteString -> CypherException CypherClientParseException :: ByteString -> CypherException type Hostname = ByteString type Port = Int -- | OneTuple is the singleton tuple data type. data OneTuple a :: * -> * -- | singleton tuple constructor OneTuple :: a -> OneTuple a instance Typeable CypherException instance Show CypherException instance FromJSON a => FromCypher (Maybe a) instance (FromJSON a, FromJSON b, FromJSON c) => FromCypher (a, b, c) instance (FromJSON a, FromJSON b) => FromCypher (a, b) instance FromJSON a => FromCypher (OneTuple a) instance FromJSON a => FromCypher [a] instance FromJSON a => FromCypher (CypherResult a) instance FromCypher () instance Monad Cypher instance Exception CypherException instance FromJSON CypherRequest instance ToJSON CypherRequest instance FromJSON a0 => FromJSON (CypherResult a0) instance ToJSON a0 => ToJSON (CypherResult a0) instance Show a => Show (CypherResult a) instance Eq a => Eq (CypherResult a) instance Show CypherRequest instance Eq CypherRequest instance Show a => Show (Entity a) instance Eq a => Eq (Entity a) instance ToJSON a => ToJSON (OneTuple a) instance FromJSON a => FromJSON (OneTuple a) instance ToJSON (Entity a) instance FromJSON a => FromJSON (Entity a)