Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simple data structure that can act as a physical world to simulate. I will likely implement more interesting world data structures in the future.
- data World a = World {
- _worldObjs :: !(IntMap a)
- _worldNextKey :: !Int
- worldObjs :: forall a a. Lens (World a) (World a) (IntMap a) (IntMap a)
- worldNextKey :: forall a. Lens' (World a) Int
- emptyWorld :: World a
- addObj :: World a -> a -> World a
- addObj' :: World a -> a -> (Int, World a)
- fromList :: [a] -> World a
Documentation
A simple PhysicsWorld
implementation using IntMap
World | |
|
emptyWorld :: World a Source #
A World
without any inhabitants.