title: Accessing state in an IO-Monad
body: <p>I'm trying to access a state of a State Monad inside an IO action.</p>
  <p>More specifically: I'm trying to write a state-dependent signal handler using <code>installHandler</code>from <a href="https://hackage.haskell.org/package/unix-2.7.2.2/docs/System-Posix-Signals.html" rel="nofollow noreferrer">System.Posix.Signals</a> which requires <code>IO</code>, however, I'd like to do different actions and change the state from inside the handler. I took a look at <a href="https://hackage.haskell.org/package/unliftio" rel="nofollow noreferrer">unliftio</a>, but I read that State-Monads shouldn't be unlifted.</p>
  <p>Is this possible? I'm more looking for an explanation than for a &quot;copy-paste&quot; solution. If unlifting State inside IO doesn't work, what would a solution look like, for when one wants to do some state-aware processing inside IO?</p>