aztecs-0.11.1: A modular game engine and Entity-Component-System (ECS) for Haskell.
Copyright(c) Matt Hunzinger 2025
LicenseBSD-style (see the LICENSE file in the distribution)
Maintainermatt@hunzinger.me
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Aztecs.ECS.World.Storage

Description

 
Synopsis

Documentation

class (Typeable s, NFData s, Typeable a) => Storage a s where Source #

Component storage, containing zero or many components of the same type.

Since: 0.9

Methods

singleton :: a -> s Source #

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

Instances details
(Typeable a, NFData a) => Storage a [a] Source #

Since: 0.11

Instance details

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 #