<br><div class="gmail_quote">On Fri, Feb 1, 2008 at 5:04 PM, Nicolas Pouillard &lt;<a href="mailto:nicolas.pouillard@gmail.com">nicolas.pouillard@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Excerpts from Brent Yorgey&#39;s message of Fri Feb 01 22:53:20 +0100 2008:<br>
<div><div></div><div class="Wj3C7c">&gt; On Thu, Jan 31, 2008 at 2:42 PM, Spencer Janssen &lt;<a href="mailto:sjanssen@cse.unl.edu">sjanssen@cse.unl.edu</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Wed, Jan 30, 2008 at 07:29:58PM -0500, Brent Yorgey wrote:<br>
&gt; &gt; &gt; &nbsp; 1. PerWorkspace is an inelegant hack with several icky problems:<br>
&gt; &gt;<br>
&gt; &gt; Agreed. &nbsp;It is approaching the limits of xmonad&#39;s layout design. &nbsp;However,<br>
&gt; &gt; I<br>
&gt; &gt; think we can accomplish PerWorkspace behavior without changing too much.<br>
&gt; &gt;<br>
&gt; &gt; \begin{code}<br>
&gt; &gt; data PerWS = PerWS { selected :: Maybe Layout<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , choices &nbsp;:: Map WorkspaceId Layout<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; , default &nbsp;:: Layout }<br>
&gt; &gt; \end{code}<br>
&gt; &gt;<br>
&gt;<br>
&gt; So, I took a crack at implementing (something like) this today. &nbsp;The problem<br>
&gt; I ran into is that (Layout a) is not an instance of Read, so PerWorkspace<br>
&gt; cannot derive Read either. &nbsp;Is there any way around this? &nbsp;Or do I have to<br>
&gt; go back to caching a (Maybe Bool) and using that to decide on which of two<br>
&gt; layouts to use, instead of directly caching a (Maybe (Layout a))?<br>
&gt;<br>
&gt; Ideas?<br>
<br>
</div></div>What about &quot;instance Read a =&gt; Read (Layout a)&quot;?<br>
<font color="#888888"></font></blockquote><br>Well, since Layout is an existential wrapper, that&#39;s not possible -- it hides the type of the wrapped layout.&nbsp; I know that lots of work has already gone into the xmonad core getting around this issue. =)<br>
<br>
Hmm, just thinking out loud here... note that I don&#39;t actually care
about being able to read the (Layout a) value back in, since after
serialization/restart the startupHook will get run again anyway, and
the correct workspace will get re-cached.&nbsp; So perhaps I can just write my own explicit Read instance for PerWorkspace that somehow ignores that element and just initializes the read value to Nothing.&nbsp; Sounds scary. =)<br>
<br>-Brent<br><br></div>