title: Restoring terminal settings on exit
body: <p>Using <a href="https://hackage.haskell.org/package/terminal-0.2.0.0" rel="noreferrer">the <code>terminal</code> package</a>, my code basically looks like this:</p>
  <pre><code>main :: IO ()
  main = withTerminal $ runTerminalT $ do
      eraseInDisplay EraseAll
      hideCursor
      setAutoWrap False
  
      forever $ do
          calculate
          updateScreen
  </code></pre>
  <p>If the user exits this program with <kbd>Ctrl-C</kbd>, the terminal settings (in this concrete case, the hidden cursor) remain. I am looking for a lightweight way to <strong>restore the terminal settings as they were before running the program</strong>. By lightweight, I mean something that I can just wrap around the whole <code>runTerminalT</code> shebang, instead of having to manually call <code>checkInterrupt</code> at various parts of my code etc.</p>