Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data LocalStateQueryExpr block point query r m a
- executeLocalStateQueryExpr ∷ LocalNodeConnectInfo mode → Maybe ChainPoint → (NodeToClientVersion → LocalStateQueryExpr (BlockInMode mode) ChainPoint (QueryInMode mode) () IO a) → IO (Either AcquireFailure a)
- executeLocalStateQueryExprWithChainSync ∷ LocalNodeConnectInfo mode → Maybe ChainPoint → (NodeToClientVersion → LocalStateQueryExpr (BlockInMode mode) ChainPoint (QueryInMode mode) () IO a) → IO (ChainTip, Either AcquireFailure a)
- queryExpr ∷ QueryInMode mode a → LocalStateQueryExpr block point (QueryInMode mode) r IO a
- determineEraExpr ∷ ConsensusModeParams mode → LocalStateQueryExpr block point (QueryInMode mode) r IO AnyBccEra
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
Monad (LocalStateQueryExpr block point query r m) Source # | |
Defined in Bcc.Api.IPC.Monad (>>=) ∷ 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 # | |
Defined in Bcc.Api.IPC.Monad 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 # | |
Defined in Bcc.Api.IPC.Monad 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 # | |
Defined in Bcc.Api.IPC.Monad liftIO ∷ IO a → LocalStateQueryExpr block point query r m a Source # |
executeLocalStateQueryExpr ∷ LocalNodeConnectInfo mode → Maybe ChainPoint → (NodeToClientVersion → LocalStateQueryExpr (BlockInMode mode) ChainPoint (QueryInMode mode) () IO a) → IO (Either AcquireFailure a) Source #
Execute a local state query expression.
executeLocalStateQueryExprWithChainSync ∷ LocalNodeConnectInfo mode → Maybe ChainPoint → (NodeToClientVersion → LocalStateQueryExpr (BlockInMode mode) ChainPoint (QueryInMode mode) () IO a) → IO (ChainTip, Either AcquireFailure a) Source #
Execute a local state query expression concurrently with a chain sync.
queryExpr ∷ QueryInMode mode a → LocalStateQueryExpr block point (QueryInMode mode) r IO a Source #
Use queryExpr
in a do block to construct monadic local state queries.
determineEraExpr ∷ ConsensusModeParams mode → LocalStateQueryExpr block point (QueryInMode mode) r IO AnyBccEra Source #
A monad expresion that determines what era the node is in.