Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- data Array (a :: Type)
- makeArray :: IsKey k ns => Value k ns ~ Array a => k -> Store ns -> Value k ns
- makeFullStoreKey :: Array a -> Word64 -> StoreKey
- append :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => a -> Array a -> Sem r ()
- length :: Members [Error AppError, ReadStore] r => Array a -> Sem r Word64
- foldl :: Members [Error AppError, ReadStore] r => HasCodec a => (b -> a -> b) -> b -> Array a -> Sem r b
- modifyAtIndex :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => Word64 -> (a -> a) -> Array a -> Sem r (Maybe a)
- deleteWhen :: Members [Error AppError, ReadStore, WriteStore] r => HasCodec a => (a -> Bool) -> Array a -> Sem r ()
- (!!) :: Members [Error AppError, ReadStore] r => HasCodec a => Array a -> Word64 -> Sem r (Maybe a)
- elemIndex :: Members [Error AppError, ReadStore] r => HasCodec a => Eq a => a -> Array a -> Sem r (Maybe Word64)
- toList :: Members [Error AppError, ReadStore] r => HasCodec a => Array a -> Sem r [a]

# 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

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

Defined in Tendermint.SDK.BaseApp.Query.Store 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 # | |

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.

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

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.