Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data LocalStateQueryExpr block point (query :: Type -> Type) r (m :: Type -> Type) a
- executeLocalStateQueryExpr :: LocalNodeConnectInfo -> Target ChainPoint -> LocalStateQueryExpr BlockInMode ChainPoint QueryInMode () IO a -> IO (Either AcquiringFailure a)
- queryExpr :: QueryInMode a -> LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError a)
Documentation
data LocalStateQueryExpr block point (query :: Type -> Type) r (m :: Type -> Type) 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
MonadReader NodeToClientVersion (LocalStateQueryExpr block point query r m) Source # | |
Defined in Cardano.Api.IPC.Monad ask :: LocalStateQueryExpr block point query r m NodeToClientVersion Source # local :: (NodeToClientVersion -> NodeToClientVersion) -> LocalStateQueryExpr block point query r m a -> LocalStateQueryExpr block point query r m a Source # reader :: (NodeToClientVersion -> a) -> LocalStateQueryExpr block point query r m a Source # | |
MonadIO m => MonadIO (LocalStateQueryExpr block point query r m) Source # | |
Defined in Cardano.Api.IPC.Monad liftIO :: IO a -> LocalStateQueryExpr block point query r m a Source # | |
Applicative (LocalStateQueryExpr block point query r m) Source # | |
Defined in Cardano.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 # | |
Functor (LocalStateQueryExpr block point query r m) Source # | |
Defined in Cardano.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 # | |
Monad (LocalStateQueryExpr block point query r m) Source # | |
Defined in Cardano.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 # |
executeLocalStateQueryExpr :: LocalNodeConnectInfo -> Target ChainPoint -> LocalStateQueryExpr BlockInMode ChainPoint QueryInMode () IO a -> IO (Either AcquiringFailure a) Source #
Execute a local state query expression.
queryExpr :: QueryInMode a -> LocalStateQueryExpr block point QueryInMode r IO (Either UnsupportedNtcVersionError a) Source #
Use queryExpr
in a do block to construct monadic local state queries.