HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleapecs-0.9.6Haskell2010

Apecs.System

  • 17 values
  • Packageapecs-0.9.6
  • Exports17
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSystem.hs
valuerunWith :: w -> SystemT w m a -> m a
#

Run a system in a game world

valueset :: Set w m c => Entity -> c -> SystemT w m ()
#

Writes a Component to a given Entity. Will overwrite existing Components.

value($=) :: Set w m c => Entity -> c -> SystemT w m ()
#

Writes a Component to a given Entity. Will overwrite existing Components.

set operator

value($~) :: (Get w m cx, Set w m cy) => Entity -> (cx -> cy) -> SystemT w m ()
#

Applies a function, if possible.

modify operator

valuecmap
  1. :: (Get w m cx, Members w m cx, Set w m cy)
  2. => cx -> cy
  3. -> SystemT w m ()
#

Maps a function over all entities with a cx, and writes their cy.

valuecmapIf
  1. :: (Get w m cx, Get w m cp, Members w m cx, Set w m cy)
  2. => cp -> Bool
  3. -> cx -> cy
  4. -> SystemT w m ()
#

Conditional cmap, that first tests whether the argument satisfies some property. The entity needs to have both a cx and cp component.

valuecmapM
  1. :: (Get w m cx, Set w m cy, Members w m cx)
  2. => cx -> SystemT w m cy
  3. -> SystemT w m ()
#

Monadically iterates over all entites with a cx, and writes their cy.

valuecfold :: (Members w m c, Get w m c) => (a -> c -> a) -> a -> SystemT w m a
#

Fold over the game world; for example, cfold max (minBound :: Foo) will find the maximum value of Foo. Strict in the accumulator.

valuecfoldM
  1. :: (Members w m c, Get w m c)
  2. => a -> c -> SystemT w m a
  3. -> a
  4. -> SystemT w m a
#

Monadically fold over the game world. Strict in the accumulator.

valuecollect
  1. :: (Get w m components, Members w m components)
  2. => components -> Maybe a
  3. -> SystemT w m [a]
#

Collect matching components into a list by using the specified test/process function. You can use this to preprocess data before returning. And you can do a test here that depends on data from multiple components. Pass Just to simply collect all the items.