This is a simple example how to use Hasim. First, import the correct module. > import Control.Hasim Import some monad libraries > import Control.Monad.State > import Control.Monad Now, define a simulation with actions. This will be a very simple example. > simdef = do > p1 <- mkProcess "sender" 0 > p2 <- mkProcess "receiver" () > p1 `setAction` p1act p2 > p2 `setAction` p2act Define the actions that belong to these processes. The receiver, p2, will just receive packets and print the contents on the screen, > p2act = do > p <- receive > t <- getTime > liftIO $ putStrLn $ "received on t = " ++ show t ++ ", " ++ show p > p2act The sender, will keep sending packets with increasing integers, until 37 is reached. > p1act p2 = do > i <- get > put $ i + 1 > wait 4 > unless (i >= 37) $ do > sendBlock i p2 > p1act p2 Now define the main function: > main = createSimulation simdef >>= runSimulation