HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleapecs-0.9.6Haskell2010

Apecs.Core

  • 7 types
  • 7 classes
  • Packageapecs-0.9.6
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceCore.hs
newtypenewtype Entity
#

An Entity is just an integer, used to index into a component store. In general, use newEntity, cmap, and component tags instead of manipulating these directly.

For performance reasons, negative values like (-1) are reserved for stores to represent special values, so avoid using these.

Constructors

Instances8Enum, Eq, Num, Ord, Show, Component, …
newtypenewtype SystemT w (m :: Type -> Type) a
#

A SystemT is a newtype around `ReaderT w m a`, where w is the game world variable. Systems serve to

  • Allow type-based lookup of a component's store through getStore.

  • Lift side effects into their host Monad.

Constructors

Instances10MonadReader, MonadTrans, Monad, Functor, Applicative, MonadIO, …
classclass Elem (Storage c) ~ c => Component c where
#

A component is defined by specifying how it is stored. The constraint ensures that stores and components are mapped one-to-one.

Associated types

Instances21Component, …
classclass (Monad m, Component c) => Has w (m :: Type -> Type) c where
#

Has w m c means that world w can produce a Storage c. It is parameterized over m to allow stores to be foreign.

Methods

Instances19Has, …
  • Monad m => Has w m EntityDefined in apecs-0.9.6 · Apecs.Components · orphan
  • Monad m => Has w m ()Defined in apecs-0.9.6 · Apecs.Components · orphan
  • Has w m c => Has w m (Filter c)Defined in apecs-0.9.6 · Apecs.Components
  • Has w m c => Has w m (Not c)Defined in apecs-0.9.6 · Apecs.Components
  • Has w m c => Has w m (Head c)Defined in apecs-0.9.6 · Apecs.Experimental.Components
  • Has w m c => Has w m (Redirect c)Defined in apecs-0.9.6 · Apecs.Experimental.Components
  • Has w m c => Has w m (Identity c)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • Has w m c => Has w m (Maybe c)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Storage c ~ Pushdown s c, Has w m c) => Has w m (Stack c)Defined in apecs-0.9.6 · Apecs.Experimental.Stores
  • (MonadIO m, Component c, Has w m (Child c)) => Has w m (ChildList c)Defined in apecs-0.9.6 · Apecs.Experimental.Children
  • (MonadIO m, Component c, Has w m (Child c)) => Has w m (ChildValue c)Defined in apecs-0.9.6 · Apecs.Experimental.Children
  • (Has w m ca, Has w m cb) => Has w m (Either ca cb)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1) => Has w m (t_0, t_1)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2) => Has w m (t_0, t_1, t_2)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3) => Has w m (t_0, t_1, t_2, t_3)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4) => Has w m (t_0, t_1, t_2, t_3, t_4)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5, Has w m t_6) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5, t_6)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • (Has w m t_0, Has w m t_1, Has w m t_2, Has w m t_3, Has w m t_4, Has w m t_5, Has w m t_6, Has w m t_7) => Has w m (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7)Defined in apecs-0.9.6 · Apecs.Components · orphan
familytype family Elem s
#

The type of components stored by a store, e.g. Elem (Map c) = c.

Instances32Elem, …
  • type Elem EntityStore = EntityDefined in apecs-0.9.6 · Apecs.Components
  • type Elem (EitherStore sa sb) = Either (Elem sa) (Elem sb)Defined in apecs-0.9.6 · Apecs.Components
  • type Elem (FilterStore s) = Filter (Elem s)Defined in apecs-0.9.6 · Apecs.Components
  • type Elem (MaybeStore s) = Maybe (Elem s)Defined in apecs-0.9.6 · Apecs.Components
  • type Elem (NotStore s) = Not (Elem s)Defined in apecs-0.9.6 · Apecs.Components
  • type Elem (ChildListStore s) = ChildList (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Children
  • type Elem (ChildValueStore s) = ChildValue (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Children
  • type Elem (Children s) = Child (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Children
  • type Elem (HeadStore s) = Head (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Components
  • type Elem (RedirectStore s) = Redirect (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Components
  • type Elem (ComponentCounter c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (EnumMap c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (IxMap c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (OrdMap c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (Printer c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (Reactive r s) = Elem sDefined in apecs-0.9.6 · Apecs.Experimental.Reactive
  • type Elem (Pushdown s c) = cDefined in apecs-0.9.6 · Apecs.Experimental.Stores
  • type Elem (StackStore s) = Stack (Elem s)Defined in apecs-0.9.6 · Apecs.Experimental.Stores
  • type Elem (Cache n s) = Elem sDefined in apecs-0.9.6 · Apecs.Stores
  • type Elem (Global c) = cDefined in apecs-0.9.6 · Apecs.Stores
  • type Elem (Map c) = cDefined in apecs-0.9.6 · Apecs.Stores
  • type Elem (ReadOnly s) = Elem sDefined in apecs-0.9.6 · Apecs.Stores
  • type Elem (Unique c) = cDefined in apecs-0.9.6 · Apecs.Stores
  • type Elem (Identity s) = Identity (Elem s)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem () = ()Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1) = (Elem t_0, Elem t_1)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2) = (Elem t_0, Elem t_1, Elem t_2)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2, t_3) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2, t_3, t_4) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2, t_3, t_4, t_5) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5, Elem t_6)Defined in apecs-0.9.6 · Apecs.Components · orphan
  • type Elem (t_0, t_1, t_2, t_3, t_4, t_5, t_6, t_7) = (Elem t_0, Elem t_1, Elem t_2, Elem t_3, Elem t_4, Elem t_5, Elem t_6, Elem t_7)Defined in apecs-0.9.6 · Apecs.Components · orphan
classclass ExplInit (m :: Type -> Type) s where
#

Indicates that the store s can be initialized. Generally, "base" stores like Map c can be initialized, but composite stores like MaybeStore s cannot.

Methods

  • explInit :: m s

    Initialize a new empty store.

Instances8ExplInit, …
classclass Monad m => ExplGet (m :: Type -> Type) s where
#

Stores that we can read using explGet and explExists. For some entity e, eplGet s e is only guaranteed to be safe if explExists s e returns True.

Methods

  • explGet :: s -> Int -> m (Elem s)

    Reads a component from the store. What happens if the component does not exist is left undefined, and might not necessarily crash.

  • explExists :: s -> Int -> m Bool

    Returns whether there is a component for the given index.

Instances26ExplGet, …
classclass Monad m => ExplSet (m :: Type -> Type) s where
#

Stores that can be written.

Methods

Instances21ExplSet, …
classclass Monad m => ExplDestroy (m :: Type -> Type) s where
#

Stores that components can be removed from.

Methods

  • explDestroy :: s -> Int -> m ()

    Destroys the component for a given index.

Instances18ExplDestroy, …
classclass Monad m => ExplMembers (m :: Type -> Type) s where
#

Stores that we can request a list of member entities for.

Methods

Instances20ExplMembers, …