title: How can I modify the windowSet in XMonad?
body: <p>I have a function that looks like:</p>
  
  <pre><code>sinkFocus :: StackSet i l a s sd -&gt; Maybe (StackSet i l a s sd)
  sinkFocus = (fmap . flip sink) &lt;*&gt; peek
  </code></pre>
  
  <p>However I would like an <code>X ()</code> so that I can use it.  For example <code>additionalKeys</code> uses an <code>X ()</code>.</p>
  
  <p>The documentation says that <code>X</code> is a <code>IO</code> with some state and reader transformers, so I am under the impression that the <code>StackSet</code> is contained within the state of <code>X</code>.  So in theory it should be possible to modify the relevant part of the state.  However the state accessible is <code>XState</code> not the <code>StackState</code> I want, so I need to be able to turn my function on <code>StackState</code> to one on <code>XState</code>.</p>
  
  <p>This would be easy enough if I had a function of the type</p>
  
  <pre><code>(StackSet i l a s sd -&gt; StackSet i l a s sd) -&gt; X ()
  </code></pre>
  
  <p>However after digging around in the documentation I haven't been able to piece together a way to do this yet.  Is there a way to take a function on <code>StackSet</code> and make an <code>X ()</code> that performs that function?   </p>