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.Components

  • 7 types
  • Packageapecs-0.9.6
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceComponents.hs
datadata Not a
#

Pseudocomponent indicating the absence of a. Mainly used as e.g. cmap $ (a, Not b) -> c to iterate over entities with an a but no b. Can also be used to delete components, like cmap $ a -> (Not :: Not a) to delete every a component.

Instances3Has, Component, Storage
newtypenewtype NotStore s
#

Pseudostore used to produce values of type Not a, inverts explExists, and destroys instead of explSet.

Constructors

Instances3ExplGet, ExplSet, Elem
newtypenewtype MaybeStore s
#

Pseudostore used to produce values of type Maybe a. Will always return True for explExists. Writing can both set and delete a component using Just and Nothing respectively.

Constructors

Instances3ExplGet, ExplSet, Elem
datadata EitherStore sa sb
#

Used for Either, a logical disjunction between two components. As expected, Either is used to model error values. Getting an Either a b will first attempt to get a b and return it as Right b, or if it does not exist, get an a as Left a. Can also be used to set one of two things.

Constructors

Instances4ExplDestroy, ExplGet, ExplSet, Elem
datadata Filter c
#

Pseudocomponent that functions normally for explExists and explMembers, but always return Filter for explGet. Can be used in cmap as cmap $ (Filter :: Filter a) -> b. Since the above can be written more consicely as cmap $ (_ :: a) -> b, it is rarely directly. More interestingly, we can define reusable filters like movables = Filter :: Filter (Position, Velocity). Note that 'Filter c' is equivalent to 'Not (Not c)'.

Instances5Has, Eq, Show, Component, Storage
datadata EntityStore
#

Pseudostore used to produce components of type Entity. Always returns True for explExists, and echoes back the entity argument for explGet. Used in e.g. cmap $ (a, ety :: Entity) -> b to access the current entity.

Instances2ExplGet, Elem

Orphan instances

59 instances