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