--------------------------------------------------------------------------------

testCameraVM :: Tower e ()
testCameraVM = do
  towerModule  towerDepModule
  towerDepends towerDepModule

  reboot_chan <- channel
  rx <- cameraVMTower (snd reboot_chan :: ChanOutput ('Stored IBool))

  monitor "receiverMonitor" $
    handler rx "receiver" $
     callback $ \msg -> do
       call_ printf "left   %u\n" =<< deref (msg ~> bbox_l)
       call_ printf "right  %u\n" =<< deref (msg ~> bbox_r)
       call_ printf "top    %u\n" =<< deref (msg ~> bbox_t)
       call_ printf "bottom %u\n" =<< deref (msg ~> bbox_b)

--------------------------------------------------------------------------------
-- Compiler
testCameraVM :: Tower e ()
testCameraVM = do
  towerModule  towerDepModule
  towerDepends towerDepModule

  reboot_chan <- channel
  rx <- cameraVMTower (snd reboot_chan :: ChanOutput ('Stored IBool))

  monitor "receiverMonitor" $
    handler rx "receiver" $
     callback $ \msg -> do
       call_ printf "left   %u\n" =<< deref (msg ~> bbox_l)
       call_ printf "right  %u\n" =<< deref (msg ~> bbox_r)
       call_ printf "top    %u\n" =<< deref (msg ~> bbox_t)
       call_ printf "bottom %u\n" =<< deref (msg ~> bbox_b)

--------------------------------------------------------------------------------
-- Compiler
testCameraVM = do
  towerModule  towerDepModule
  towerDepends towerDepModule

  reboot_chan <- channel
  rx <- cameraVMTower (snd reboot_chan :: ChanOutput ('Stored IBool))

  monitor "receiverMonitor" $
    handler rx "receiver" $
     callback $ \msg -> do
       call_ printf "left   %u\n" =<< deref (msg ~> bbox_l)
       call_ printf "right  %u\n" =<< deref (msg ~> bbox_r)
       call_ printf "top    %u\n" =<< deref (msg ~> bbox_t)
       call_ printf "bottom %u\n" =<< deref (msg ~> bbox_b)

--------------------------------------------------------------------------------
-- Compiler