hs-abci-sdk-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Tendermint.SDK.BaseApp.Store.Array

Synopsis

Documentation

data Array (a :: Type) Source #

A 'Array a' is an appendable list whose elements can be accessed | by their index. You can also delete from the list, in which case accessing | that index will result in a Nothing.

Instances

Instances details
(HasCodec a, Member (Tagged 'QueryAndMempool (ReadStore :: (Type -> Type) -> Type -> Type)) r) => HasQueryRouter (StoreLeaf (Array a) :: Type) r Source # 
Instance details

Defined in Tendermint.SDK.BaseApp.Query.Store

Associated Types

type RouteQ (StoreLeaf (Array a)) r Source #

Methods

routeQ :: Proxy (StoreLeaf (Array a)) -> Proxy r -> Delayed (Sem r) env QueryRequest (RouteQ (StoreLeaf (Array a)) (QueryEffs :& r)) -> Router env r QueryRequest Query Source #

hoistQueryRouter :: forall (s :: EffectRow) (s' :: EffectRow). Proxy (StoreLeaf (Array a)) -> Proxy r -> (forall a0. Sem s a0 -> Sem s' a0) -> RouteQ (StoreLeaf (Array a)) s -> RouteQ (StoreLeaf (Array a)) s' Source #

type RouteQ (StoreLeaf (Array a) :: Type) r Source # 
Instance details

Defined in Tendermint.SDK.BaseApp.Query.Store

type RouteQ (StoreLeaf (Array a) :: Type) r = RouteQ (QA Word64 :> Leaf a) r

makeArray :: IsKey k ns => Value k ns ~ Array a => k -> Store ns -> Value k ns Source #

Smart constuctor to make sure we're making a Array from | the appropriate key type.

append :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => a -> Array a -> Sem r () Source #

Add an item to the end of the list.

modifyAtIndex :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => Word64 -> (a -> a) -> Array a -> Sem r (Maybe a) Source #

Modify a list at a particular index, return the | updated value if the element was found.

deleteWhen :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => (a -> Bool) -> Array a -> Sem r () Source #

Delete when the predicate evaluates to true.

(!!) :: Members [Error AppError, ReadStore] r => HasCodec a => Array a -> Word64 -> Sem r (Maybe a) infixl 9 Source #

Access an item directly by its index.

elemIndex :: Members [Error AppError, ReadStore] r => HasCodec a => Eq a => a -> Array a -> Sem r (Maybe Word64) Source #

Get the first index where an element appears in the list.

toList :: Members [Error AppError, ReadStore] r => HasCodec a => Array a -> Sem r [a] Source #

View the Array as a Array.