import Control.Concurrent (newMVar, putMVar, takeMVar )

arrIO _ =
  proc _ -> do
    counter <- newMVar 0 :: IO (MVar Int)
    takeMVar counter >>= print
    returnA -< ()

Add a code snippet to your website: www.paste.org