| 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 | Safe-Inferred | 
| Language | Haskell2010 | 
Aztecs.ECS.World.Storage
Description
Synopsis
- class (Typeable s, Typeable a) => Storage a s where
- singleton :: a -> s
 - toAscList :: s -> [a]
 - fromAscList :: [a] -> s
 - map :: (a -> a) -> s -> ([a], s)
 - mapM :: Monad m => (a -> m a) -> s -> m ([a], s)
 - zipWith :: (b -> a -> (c, a)) -> [b] -> s -> ([(c, a)], s)
 - zipWithM :: Applicative m => (b -> a -> m (c, a)) -> [b] -> s -> m ([(c, a)], s)
 
 
Documentation
class (Typeable s, Typeable a) => Storage a s where Source #
Component storage, containing zero or many components of the same type.
Since: 0.9
Methods
Storage with a single component.
Since: 0.9
toAscList :: s -> [a] Source #
List of all components in the storage in ascending order.
Since: 0.9
fromAscList :: [a] -> s Source #
Convert a sorted list of components (in ascending order) into a storage.
Since: 0.9
map :: (a -> a) -> s -> ([a], s) Source #
Map a function over all components in the storage.
Since: 0.11
mapM :: Monad m => (a -> m a) -> s -> m ([a], s) Source #
Map a monadic function over all components in the storage.
Since: 0.11
zipWith :: (b -> a -> (c, a)) -> [b] -> s -> ([(c, a)], s) Source #
Map a function with some input over all components in the storage.
Since: 0.11
zipWithM :: Applicative m => (b -> a -> m (c, a)) -> [b] -> s -> m ([(c, a)], s) Source #
Map an applicative functor with some input over all components in the storage.
Since: 0.11
Instances
| Typeable a => Storage a [a] Source # | Since: 0.11  | 
Defined in Aztecs.ECS.World.Storage Methods singleton :: a -> [a] Source # toAscList :: [a] -> [a] Source # fromAscList :: [a] -> [a] Source # map :: (a -> a) -> [a] -> ([a], [a]) Source # mapM :: Monad m => (a -> m a) -> [a] -> m ([a], [a]) Source # zipWith :: (b -> a -> (c, a)) -> [b] -> [a] -> ([(c, a)], [a]) Source # zipWithM :: Applicative m => (b -> a -> m (c, a)) -> [b] -> [a] -> m ([(c, a)], [a]) Source #  | |