| Copyright | (c) Matt Hunzinger 2025 |
|---|---|
| License | BSD-style (see the LICENSE file in the distribution) |
| Maintainer | matt@hunzinger.me |
| Stability | provisional |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Aztecs.ECS.World.Storage
Description
Synopsis
- class (Typeable s, Typeable a) => Storage a s where
- singleton :: a -> s
- toAscVector :: s -> Vector a
- fromAscVector :: Vector a -> s
- map :: (a -> a) -> s -> s
- zipWith :: (i -> a -> a) -> Vector i -> s -> (Vector a, s)
- zipWithM :: Monad m => (i -> a -> m a) -> Vector i -> s -> m (Vector a, s)
- zipWith_ :: (i -> a -> a) -> Vector i -> s -> s
- zipWithAccum :: (i -> a -> (o, a)) -> Vector i -> s -> (Vector (o, a), s)
- zipWithAccumM :: Monad m => (i -> a -> m (o, a)) -> Vector i -> s -> m (Vector (o, a), s)
Documentation
class (Typeable s, Typeable a) => Storage a s where Source #
Component storage, containing zero or many components of the same type.
Minimal complete definition
singleton, toAscVector, fromAscVector, map, zipWith, zipWithM, zipWithAccum, zipWithAccumM
Methods
Storage with a single component.
toAscVector :: s -> Vector a Source #
Vector of all components in the storage in ascending order.
fromAscVector :: Vector a -> s Source #
Convert a sorted vector of components (in ascending order) into a storage.
map :: (a -> a) -> s -> s Source #
Map a function over all components in the storage.
zipWith :: (i -> a -> a) -> Vector i -> s -> (Vector a, s) Source #
Map a function with some input over all components in the storage.
zipWithM :: Monad m => (i -> a -> m a) -> Vector i -> s -> m (Vector a, s) Source #
Map an applicative functor with some input over all components in the storage.
zipWith_ :: (i -> a -> a) -> Vector i -> s -> s Source #
Map a function with some input over all components in the storage.
zipWithAccum :: (i -> a -> (o, a)) -> Vector i -> s -> (Vector (o, a), s) Source #
Map a function with some input over all components, returning a tuple result and updated storage.
zipWithAccumM :: Monad m => (i -> a -> m (o, a)) -> Vector i -> s -> m (Vector (o, a), s) Source #
Map a monadic function with some input over all components, returning a tuple result and updated storage.
Instances
| Typeable a => Storage a (Vector a) Source # | |
Defined in Aztecs.ECS.World.Storage Methods singleton :: a -> Vector a Source # toAscVector :: Vector a -> Vector a Source # fromAscVector :: Vector a -> Vector a Source # map :: (a -> a) -> Vector a -> Vector a Source # zipWith :: (i -> a -> a) -> Vector i -> Vector a -> (Vector a, Vector a) Source # zipWithM :: Monad m => (i -> a -> m a) -> Vector i -> Vector a -> m (Vector a, Vector a) Source # zipWith_ :: (i -> a -> a) -> Vector i -> Vector a -> Vector a Source # zipWithAccum :: (i -> a -> (o, a)) -> Vector i -> Vector a -> (Vector (o, a), Vector a) Source # zipWithAccumM :: Monad m => (i -> a -> m (o, a)) -> Vector i -> Vector a -> m (Vector (o, a), Vector a) Source # | |