Yes, agreed. Got any clue on the original problem (except to use Data.Map)?<br><br><div class="gmail_quote">On Mon, Apr 13, 2009 at 6:55 PM, Jason Dagit <span dir="ltr">&lt;<a href="mailto:dagit@codersbase.com">dagit@codersbase.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Others have provided help to answer your question but I&#39;d like to<br>
provide a little bit different feedback.<br>
<div class="im"><br>
On Mon, Apr 13, 2009 at 8:42 AM, John Smith &lt;<a href="mailto:smithsnorth@gmail.com">smithsnorth@gmail.com</a>&gt; wrote:<br>
&gt; Hi, a java-programmer running into trouble while trying to learn Haskell.<br>
&gt;<br>
&gt; I try to make a hash containing hashes but can not getting a value out of<br>
&gt; the innermost hash - I keep running into type-trouble where IO and Maybe<br>
&gt; monad is getting mixed?<br>
&gt;<br>
&gt; My attempt:<br>
&gt;<br>
&gt; removeMaybeHash x =<br>
&gt;   case x of<br>
&gt;   Just ref -&gt; ref<br>
&gt;   Nothing -&gt; HashTable.new (==) (\key -&gt; key)<br>
<br>
</div>When you see yourself writing a function like this, you could write it<br>
like this instead:<br>
removeMaybeHash (Just ref) = ref<br>
removeMaybeHash Nothing = HashTable.new (==) (\key -&gt; key)<br>
<br>
Hopefully you agree this 2 line version is more clear.  You could go<br>
further of course and use the function &#39;maybe&#39; from the prelude, and<br>
pass the function &#39;id&#39; instead of \key -&gt; key, but I don&#39;t want to<br>
overwhelm you.<br>
<br>
Good luck,<br>
<font color="#888888">Jason<br>
</font></blockquote></div><br>