cardano-api:internal
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.IPC.Monad

Synopsis

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

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

Defined in Cardano.Api.IPC.Monad

Methods

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 # 
Instance details

Defined in Cardano.Api.IPC.Monad

Methods

liftIO :: IO a -> LocalStateQueryExpr block point query r m a Source #

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

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 #

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

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 #

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

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 #

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.