bcc-api-1.99.0
Safe HaskellNone
LanguageHaskell2010

Bcc.Api.IPC.Monad

Synopsis

Documentation

data LocalStateQueryExpr block point query r m a Source #

Monadic type for constructing local state query expressions.

Use queryExpr in a do block to construct queries of this type and convert the expression to a LocalStateQueryClient with setupLocalStateQueryExpr.

Some consideration was made to use Applicative instead of Monad as the abstraction in order to support pipelining, but we actually have a fair amount of code where the next query depends on the result of the former and therefore actually need Monad.

In order to make pipelining still possible we can explore the use of Selective Functors which would allow us to straddle both worlds.

Instances

Instances details
Monad (LocalStateQueryExpr block point query r m) Source # 
Instance details

Defined in Bcc.Api.IPC.Monad

Methods

(>>=)LocalStateQueryExpr block point query r m a → (a → LocalStateQueryExpr block point query r m b) → LocalStateQueryExpr block point query r m b Source #

(>>)LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b → LocalStateQueryExpr block point query r m b Source #

return ∷ a → LocalStateQueryExpr block point query r m a Source #

Functor (LocalStateQueryExpr block point query r m) Source # 
Instance details

Defined in Bcc.Api.IPC.Monad

Methods

fmap ∷ (a → b) → LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b Source #

(<$) ∷ a → LocalStateQueryExpr block point query r m b → LocalStateQueryExpr block point query r m a Source #

Applicative (LocalStateQueryExpr block point query r m) Source # 
Instance details

Defined in Bcc.Api.IPC.Monad

Methods

pure ∷ a → LocalStateQueryExpr block point query r m a Source #

(<*>)LocalStateQueryExpr block point query r m (a → b) → LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b Source #

liftA2 ∷ (a → b → c) → LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b → LocalStateQueryExpr block point query r m c Source #

(*>)LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b → LocalStateQueryExpr block point query r m b Source #

(<*)LocalStateQueryExpr block point query r m a → LocalStateQueryExpr block point query r m b → LocalStateQueryExpr block point query r m a Source #

MonadIO m ⇒ MonadIO (LocalStateQueryExpr block point query r m) Source # 
Instance details

Defined in Bcc.Api.IPC.Monad

Methods

liftIOIO a → LocalStateQueryExpr block point query r m a Source #

executeLocalStateQueryExprWithChainSyncLocalNodeConnectInfo mode → Maybe ChainPoint → (NodeToClientVersionLocalStateQueryExpr (BlockInMode mode) ChainPoint (QueryInMode mode) () IO a) → IO (ChainTip, Either AcquireFailure a) Source #

Execute a local state query expression concurrently with a chain sync.

queryExprQueryInMode mode a → LocalStateQueryExpr block point (QueryInMode mode) r IO a Source #

Use queryExpr in a do block to construct monadic local state queries.

determineEraExprConsensusModeParams mode → LocalStateQueryExpr block point (QueryInMode mode) r IO AnyBccEra Source #

A monad expresion that determines what era the node is in.