HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduleapecs-0.10.1Haskell2010

Apecs.Components

Synopsis
  • Packageapecs-0.10.1
  • 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 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

Instances5ExplDestroy, ExplGet, ExplMembers, 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