module Simulation.Aivika.Trans.GPSS.Block.Assign
(assignBlock,
assignBlockM) where
import Simulation.Aivika.Trans
import Simulation.Aivika.Trans.GPSS.Block
import Simulation.Aivika.Trans.GPSS.Transact
assignBlock :: MonadDES m
=> (a -> b)
-> Block m (Transact m a) (Transact m b)
{-# INLINABLE assignBlock #-}
assignBlock :: forall (m :: * -> *) a b.
MonadDES m =>
(a -> b) -> Block m (Transact m a) (Transact m b)
assignBlock a -> b
f =
Block { blockProcess :: Transact m a -> Process m (Transact m b)
blockProcess = \Transact m a
a -> forall (m :: * -> *) a. Monad m => a -> m a
return (forall (m :: * -> *) a b. Transact m a -> (a -> b) -> Transact m b
assignTransactValue Transact m a
a a -> b
f) }
assignBlockM :: MonadDES m =>
(a -> Process m b)
-> Block m (Transact m a) (Transact m b)
{-# INLINABLE assignBlockM #-}
assignBlockM :: forall (m :: * -> *) a b.
MonadDES m =>
(a -> Process m b) -> Block m (Transact m a) (Transact m b)
assignBlockM a -> Process m b
f =
Block { blockProcess :: Transact m a -> Process m (Transact m b)
blockProcess = \Transact m a
a -> forall (c :: * -> *) (m :: * -> *) a b.
Monad c =>
Transact m a -> (a -> c b) -> c (Transact m b)
assignTransactValueM Transact m a
a a -> Process m b
f }