Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type LamportClockSim = LamportClockSimT Identity
- newtype LamportClockSimT m a = LamportClockSim (ExceptT String (StateT (Map Pid LocalTime) m) a)
- type ProcessSim = ProcessSimT Identity
- newtype ProcessSimT m a = ProcessSim (ReaderT Pid (LamportClockSimT m) a)
- runLamportClockSim :: LamportClockSim a -> Either String a
- runLamportClockSimT :: Monad m => LamportClockSimT m a -> m (Either String a)
- runProcessSim :: Pid -> ProcessSim a -> LamportClockSim a
- runProcessSimT :: Pid -> ProcessSimT m a -> LamportClockSimT m a
Lamport clock simulation
newtype LamportClockSimT m a Source #
Lamport clock simulation. Key is Pid
.
Non-present value is equivalent to (0, initial).
Instances
type ProcessSim = ProcessSimT Identity Source #
newtype ProcessSimT m a Source #
ProcessSim inside Lamport clock simulation.
ProcessSim (ReaderT Pid (LamportClockSimT m) a) |
Instances
runLamportClockSim :: LamportClockSim a -> Either String a Source #
runLamportClockSimT :: Monad m => LamportClockSimT m a -> m (Either String a) Source #
runProcessSim :: Pid -> ProcessSim a -> LamportClockSim a Source #
runProcessSimT :: Pid -> ProcessSimT m a -> LamportClockSimT m a Source #