-- 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.7 module Data.Default.NewTH deriveDefault :: Bool -> 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 -> LuceneQuery type LuceneQuery = ByteString (.>.) :: ToJSON a => Text -> a -> LuceneQuery (.<.) :: ToJSON a => Text -> a -> LuceneQuery (.=.) :: ToJSON a => Text -> a -> LuceneQuery (.&.) :: LuceneQuery -> LuceneQuery -> LuceneQuery (.|.) :: LuceneQuery -> LuceneQuery -> LuceneQuery (.-.) :: LuceneQuery -> LuceneQuery -> LuceneQuery to :: ToJSON a => a -> a -> LuceneQuery xto :: ToJSON a => a -> a -> LuceneQuery 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 Entity :: String -> String -> a -> Entity a entity_id :: Entity a -> String entity_properties :: Entity a -> String entity_data :: Entity a -> 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 type LuceneQuery = ByteString -- | Execute some number of cypher queries runCypher :: Cypher a -> DBInfo -> Manager -> IO a -- | Perform a cypher query cypher :: FromJSON a => Text -> Value -> Cypher a -- | Get a cypher node cypherGetNode :: FromJSON b => Entity b -> Cypher (Entity b) -- | Create a cypher node cypherCreate :: (ToJSON a, FromJSON b) => a -> Cypher b -- | Get the nodes matching the given lucene query cypherGet :: (ToJSON a1, FromJSON a) => a1 -> Cypher a -- | Set cypher properties. This currently cannot be done through cypher -- queries. cypherSet :: (ToJSON a, ToJSON a1) => (Entity a) -> a1 -> Cypher () -- | Convert an object to a Lucene query encoded as an ByteString. luceneEncode :: ToJSON a => a -> LuceneQuery -- | Get the http connection manager for a Cypher monad withCypherManager :: (Manager -> ResourceT IO a) -> 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 -- | Information about your neo4j configuration needed to make requests -- over the REST api. data DBInfo DBInfo :: Hostname -> Port -> DBInfo cypher_hostname :: DBInfo -> Hostname cypher_port :: DBInfo -> Port type Hostname = ByteString type Port = Int -- | A single result returned by Neo4j. newtype CypherVal a CypherVal :: a -> CypherVal a -- | Values returned by Neo4j. newtype CypherVals a CypherVals :: [a] -> CypherVals a -- | A single column returned by Neo4j. newtype CypherCol a CypherCol :: a -> CypherCol a -- | Columns returned by Neo4j. newtype CypherCols a CypherCols :: a -> CypherCols a -- | Possibly a value returned by Neo4j data CypherMaybe a CypherJust :: a -> CypherMaybe a CypherNothing :: CypherMaybe a -- | No value returned from Neo4j data CypherUnit CypherUnit :: CypherUnit instance Typeable CypherException instance Show CypherException instance FromJSON CypherUnit instance FromJSON a => FromJSON (CypherMaybe a) instance FromJSON a => FromJSON (CypherVals a) instance FromJSON a => FromJSON (CypherCols a) instance FromJSON a => FromJSON (CypherCol a) instance FromJSON a => FromJSON (CypherVal a) instance MonadIO Cypher 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 Eq a => Eq (CypherVal a) instance Show a => Show (CypherVal a) instance Eq a => Eq (CypherCol a) instance Show a => Show (CypherCol a) instance Eq a => Eq (CypherCols a) instance Show a => Show (CypherCols a) instance Eq a => Eq (CypherVals a) instance Show a => Show (CypherVals a) instance Eq a => Eq (CypherMaybe a) instance Show a => Show (CypherMaybe a) instance Show CypherUnit instance Show CypherRequest instance Eq CypherRequest instance Show a => Show (Entity a) instance Eq a => Eq (Entity a) instance ToJSON (Entity a) instance FromJSON a => FromJSON (Entity a) instance FromJSON DBInfo instance ToJSON DBInfo instance Show DBInfo instance Eq DBInfo