Explicitly invoke the garbage collector
Moduleapecs-0.10.1Haskell2010
Apecs.Util
- 1 type
- 6 values
- Packageapecs-0.10.1
- Exports8
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceUtil.hs
Utility
2 declarationsConvenience entity, for use in places where the entity value does not matter, i.e. a global store.
EntityCounter
6 declarationsComponent used by newEntity to track the number of issued entities.
Automatically added to any world created with makeWorld
Constructors
Instances6Eq, Show, Semigroup, Monoid, Component, Storage
Eq EntityCounterDefined in apecs-0.10.1 · Apecs.UtilShow EntityCounterDefined in apecs-0.10.1 · Apecs.UtilSemigroup EntityCounterDefined in apecs-0.10.1 · Apecs.UtilMonoid EntityCounterDefined in apecs-0.10.1 · Apecs.UtilComponent EntityCounterDefined in apecs-0.10.1 · Apecs.Utiltype Storage EntityCounter = ReadOnly (Global EntityCounter)Defined in apecs-0.10.1 · Apecs.Util
Bumps the EntityCounter and yields its value.
Not thread-safe.
Writes the given components to a new entity, and yields that entity. The return value is often ignored.
Writes the given components to a new entity without yelding the result. Used mostly for convenience.
Atomically bumps the EntityCounter and yields its value. Relatively slower than nextEntity, but unsafeIOToSTM-safe.
Wrap tuple elements in Maybe.
This allows to safely get component packs generated by makeInstanceFold mkTupleT.
Equations
Maybify (Maybe a) = Maybe aMaybify () = ()Maybify (a, b) = (Maybify a, Maybify b)Maybify (a, b, c) = (Maybify a, Maybify b, Maybify c)Maybify (a, b, c, d) = (Maybify a, Maybify b, Maybify c, Maybify d)Maybify (a, b, c, d, e) = (Maybify a, Maybify b, Maybify c, Maybify d, Maybify e)Maybify (a, b, c, d, e, f) = (Maybify a, Maybify b, Maybify c, Maybify d, Maybify e, Maybify f)Maybify (a, b, c, d, e, f, g) = (Maybify a, Maybify b, Maybify c, Maybify d, Maybify e, Maybify f, Maybify g)Maybify (a, b, c, d, e, f, g, h) = (Maybify a, Maybify b, Maybify c, Maybify d, Maybify e, Maybify f, Maybify g, Maybify h)Maybify a = Maybe a