<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">* Every definition of tp</blockquote><div><br>I meant &quot;of type&quot;, forgetting that my emacs abbrevs don&#39;t expand in gmail.<br>
</div><br><div class="gmail_quote">On Thu, May 22, 2008 at 2:13 PM, Conal Elliott &lt;<a href="mailto:conal@conal.net">conal@conal.net</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;">
Hi Krasimir,<br><br>I had a long exchange with chessguy about this interface, suggesting a significant change in style, simplifying the type.&nbsp; (Incidentally, the change removed the State and hence mtl dependence.)<br><br>
The conversation is on <a href="http://tunes.org/%7Enef/logs/haskell/08.05.17" target="_blank">http://tunes.org/~nef/logs/haskell/08.05.17</a>, starting with &quot;12:08:11 &lt;chessguy&gt; w00t!&quot; and really picking up with &quot;&lt;conal&gt; chessguy: something smells funny ...&quot;.<br>

<br>Here&#39;s a summary of the conversation, though I encourage you to read the whole thing:<br><br>* Every definition of tp &#39;State (TreeLoc a) a&#39;, does a getLabel at the end (except getLabel).<br>* Often users of those movement functions discard the result.<br>

* Simpler and more orthogonal would be remove the getLabel and return &#39;State (TreeLoc a) ()&#39; instead.<br>* Now remove that return value altogether, simplifying the type of zipper movements to just &#39;TreeLoc a -&gt; TreeLoc a&#39;.&nbsp; Then they compose nicely with (.), having id as identity.<br>

* Simplify the type of getLabel to just &#39;TreeLoc a -&gt; a&#39;.&nbsp; Now no more State.<br><br>Cheers,&nbsp; - Conal<div><div></div><div class="Wj3C7c"><br><br><br><div class="gmail_quote">On Thu, May 22, 2008 at 12:52 PM, Krasimir Angelov &lt;<a href="mailto:kr.angelov@gmail.com" target="_blank">kr.angelov@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;">Hello Guys,<br>
<br>
We have Data.Tree in the standard libraries for a long time but for<br>
some reason we still don&#39;t have standard implementation for Zipper. I<br>
wrote recently one implementation for Yi but there are many other<br>
versions hanging around. At least I know for some. I propose to add<br>
one in the standard libraries i.e. the &quot;containers&quot; package. The<br>
version that I use currently is here:<br>
<br>
<a href="http://code.haskell.org/yi/Data/Tree/Zipper.hs" target="_blank">http://code.haskell.org/yi/Data/Tree/Zipper.hs</a><br>
<br>
If you would like to do code review I will be happy to hear comments.<br>
After the API is settled down I will write test cases also. One thing<br>
that is worying me is that the current version uses State monad which<br>
is in the &quot;mtl&quot; package while the natural place for Data.Tree.Zipper<br>
is in &quot;containers&quot;. This will create an extra dependency. Is this<br>
acceptable?<br>
<br>
Regards,<br>
 &nbsp;Krasimir<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>