Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains STM-supporting versions of regular apecs stores, and some convenience functions.
It is designed to be imported qualified, since it shadows both apecs and STM names.
There is also an Apecs.STM.Prelude
module, which can be imported by itself.
Note that if you want to be able to create entities in STM, you will also need to use a STM-supported EntityCounter
, typically done through this module's makeWorld
.
Synopsis
- newtype Map c = Map (Map Int c)
- newtype Unique c = Unique (TVar (Maybe (Int, c)))
- newtype Global c = Global (TVar c)
- makeWorldAndComponents :: String -> [Name] -> Q [Dec]
- atomically :: SystemT w STM a -> SystemT w IO a
- retry :: SystemT w STM a
- check :: Bool -> SystemT w STM ()
- forkSys :: SystemT w IO () -> SystemT w IO ThreadId
- threadDelay :: Int -> SystemT w IO ()
- data STM a
Stores
Instances
ExplDestroy STM (Map c) Source # | |
ExplDestroy IO (Map c) Source # | |
Typeable c => ExplGet STM (Map c) Source # | |
Typeable c => ExplGet IO (Map c) Source # | |
ExplInit STM (Map c) Source # | |
ExplInit IO (Map c) Source # | |
ExplMembers STM (Map c) Source # | |
ExplMembers IO (Map c) Source # | |
ExplSet STM (Map c) Source # | |
ExplSet IO (Map c) Source # | |
type Elem (Map c) Source # | |
Instances
ExplDestroy STM (Unique c) Source # | |
ExplDestroy IO (Unique c) Source # | |
Typeable c => ExplGet STM (Unique c) Source # | |
Typeable c => ExplGet IO (Unique c) Source # | |
ExplInit STM (Unique c) Source # | |
ExplInit IO (Unique c) Source # | |
ExplMembers STM (Unique c) Source # | |
ExplMembers IO (Unique c) Source # | |
ExplSet STM (Unique c) Source # | |
ExplSet IO (Unique c) Source # | |
type Elem (Unique c) Source # | |
STM conveniences
makeWorldAndComponents :: String -> [Name] -> Q [Dec] Source #
Like makeWorldAndComponents
from Apecs
, but uses the STM Map
atomically :: SystemT w STM a -> SystemT w IO a Source #
atomically
from STM, lifted to the System level.
threadDelay :: Int -> SystemT w IO () Source #
Suspends the current thread for a number of microseconds.
A monad supporting atomic memory transactions.
Instances
Alternative STM | Since: base-4.8.0.0 |
Applicative STM | Since: base-4.8.0.0 |
Functor STM | Since: base-4.3.0.0 |
Monad STM | Since: base-4.3.0.0 |
MonadPlus STM | Since: base-4.3.0.0 |
MonadBaseControl STM STM | |
ExplDestroy STM (Map c) Source # | |
ExplDestroy STM (Unique c) Source # | |
ExplGet STM (Global c) Source # | |
Typeable c => ExplGet STM (Map c) Source # | |
Typeable c => ExplGet STM (Unique c) Source # | |
Monoid c => ExplInit STM (Global c) Source # | |
ExplInit STM (Map c) Source # | |
ExplInit STM (Unique c) Source # | |
ExplMembers STM (Map c) Source # | |
ExplMembers STM (Unique c) Source # | |
ExplSet STM (Global c) Source # | |
ExplSet STM (Map c) Source # | |
ExplSet STM (Unique c) Source # | |
type StM STM a | |
Defined in Control.Monad.Trans.Control |