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.Experimental.Reactive

This module is experimental, and its API might change between point releases. Use at your own risk.

Adds the Reactive r s store, which when wrapped around store s, will call the react on its r.

Show c => Reactive (Printer c) (Map c) will print a message every time a c value is set.

Enum c => Reactive (EnumMap c) (Map c) allows you to look up entities by component value. Use e.g. withReactive $ enumLookup True to retrieve a list of entities that have a True component.

Reactive (ComponentCounter c) (Map c) tracks the current and max counts of entities with a particular component. Among other things, the max count can be useful in deciding on Cache sizing and the current count can be useful for debugging entity lifecycles. To retrieve the counts, use withReactive readComponentCount.

  • 7 types
  • 1 class
  • 5 values
  • Packageapecs-0.9.6
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceReactive.hs
classclass Monad m => Reacts (m :: Type -> Type) r where
#

Class required by Reactive. Given some r and update information about some component, will run a side-effect in monad m. Note that there are also instances for (,).

Methods

Instances5Reacts
datadata Reactive r s
#

Wrapper for reactivity around some store s.

Instances6ExplInit, ExplDestroy, ExplGet, ExplMembers, ExplSet, Elem
datadata Printer c
#

Prints a message to stdout every time a component is updated.

Instances2Reacts, Elem
newtypenewtype EnumMap c
#

Allows you to look up entities by component value. Use e.g. withReactive $ enumLookup True to retrieve a list of entities that have a True component. Based on an IntMap IntSet internally.

Instances2Reacts, Elem
newtypenewtype OrdMap c
#

Allows you to look up entities by component value. Based on a Map c IntSet internally

Instances2Reacts, Elem
  • (MonadIO m, Ord c) => Reacts m (OrdMap c)Defined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (OrdMap c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
newtypenewtype IxMap c
#

Allows you to look up entities by component value. Based on an IOArray c IntSet internally

Instances2Reacts, Elem
newtypenewtype ComponentCounter c
#

Tracks current and max counts of entities with a particular Component.

Note that if this is used in conjunction with a Global store, produced counts will always be 0.

Instances2Reacts, Elem
datadata ComponentCount c
#

A snapshot of the current and max counts of entities with a particular Component.

Produced via readComponentCount.

Constructors

Instances2Eq, Show