module Database.Bolt.Extras.DSL.Internal.Language
(
CypherDSL
, createF
, matchF
, optionalMatchF
, mergeF
, whereF
, setF
, deleteF
, detachDeleteF
, removeF
, returnF
, withF
, textF
) where
import Control.Monad.Free (Free (..), liftF)
import Data.Text (Text)
import Database.Bolt.Extras.DSL.Internal.Types (Conds (..), Expr (..),
Selectors)
type CypherDSL a = Free Expr a
createF :: Selectors -> Free Expr ()
createF :: Selectors -> Free Expr ()
createF Selectors
sels = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Selectors -> () -> Expr ()
forall next. Selectors -> next -> Expr next
Create Selectors
sels ())
matchF :: Selectors -> Free Expr ()
matchF :: Selectors -> Free Expr ()
matchF Selectors
sels = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Selectors -> () -> Expr ()
forall next. Selectors -> next -> Expr next
Match Selectors
sels ())
optionalMatchF :: Selectors -> Free Expr ()
optionalMatchF :: Selectors -> Free Expr ()
optionalMatchF Selectors
sels = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Selectors -> () -> Expr ()
forall next. Selectors -> next -> Expr next
OptionalMatch Selectors
sels ())
mergeF :: Selectors -> Free Expr ()
mergeF :: Selectors -> Free Expr ()
mergeF Selectors
sels = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Selectors -> () -> Expr ()
forall next. Selectors -> next -> Expr next
Merge Selectors
sels ())
whereF :: Conds -> Free Expr ()
whereF :: Conds -> Free Expr ()
whereF Conds
conds = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Conds -> () -> Expr ()
forall next. Conds -> next -> Expr next
Where Conds
conds ())
setF :: [Text] -> Free Expr ()
setF :: [Text] -> Free Expr ()
setF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
Set [Text]
txts ())
deleteF :: [Text] -> Free Expr ()
deleteF :: [Text] -> Free Expr ()
deleteF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
Delete [Text]
txts ())
detachDeleteF :: [Text] -> Free Expr ()
detachDeleteF :: [Text] -> Free Expr ()
detachDeleteF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
DetachDelete [Text]
txts ())
removeF :: [Text] -> Free Expr ()
removeF :: [Text] -> Free Expr ()
removeF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
Remove [Text]
txts ())
returnF :: [Text] -> Free Expr ()
returnF :: [Text] -> Free Expr ()
returnF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
Return [Text]
txts ())
withF :: [Text] -> Free Expr ()
withF :: [Text] -> Free Expr ()
withF [Text]
txts = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF ([Text] -> () -> Expr ()
forall next. [Text] -> next -> Expr next
With [Text]
txts ())
textF :: Text -> Free Expr ()
textF :: Text -> Free Expr ()
textF Text
txt = Expr () -> Free Expr ()
forall (f :: * -> *) (m :: * -> *) a.
(Functor f, MonadFree f m) =>
f a -> m a
liftF (Text -> () -> Expr ()
forall next. Text -> next -> Expr next
Text Text
txt ())