afely :: S.State -> IO () -> IO ()
safely st x = do
  r <- tryEvaluateIO x
  case r of
    Left e ->
      putLine (S.terminal st)
        ("*** Exception in callback: " ++ show e)
    Right x' ->
      return x'

--------------------------------------------------------------------------
-- the end.

safely :: S.State -> IO () -> IO ()
safely st x = do
  r <- tryEvaluateIO x
  case r of
    Left e ->
      putLine (S.terminal st)
        ("*** Exception in callback: " ++ show e)
    Right x' ->
      return x'

--------------------------------------------------------------------------
-- the end.
safely st x = do
  r <- tryEvaluateIO x
  case r of
    Left e ->
      putLine (S.terminal st)
        ("*** Exception in callback: " ++ show e)
    Right x' ->
      return x'

--------------------------------------------------------------------------
-- the end.