Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.IPC.Monad
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)
- queryExpr ∷ QueryInMode mode a → LocalStateQueryExpr block point (QueryInMode mode) r IO a
- determineEraExpr ∷ ConsensusModeParams mode → LocalStateQueryExpr block point (QueryInMode mode) r IO AnyCardanoEra
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 Cardano.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 # | |
Defined in Cardano.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 # | |
Defined in Cardano.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 # | |
Defined in Cardano.Api.IPC.Monad Methods 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.
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 AnyCardanoEra Source #
A monad expression that determines what era the node is in.