<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Look in Data.Int for a list of the Int types.</div><div><br></div><div>Basically you generally only use Int unless you are working at a lower-level which has an explicit requirement for the number of bits. &nbsp;In this case, HashTable has such a requirement, so you have two choices: &nbsp;you can either change the type annotation on dummy:</div><div><br></div><div><br></div><div>import Data.Int</div><div><br></div><div>dummy:: String -&gt; Int32<br>dummy s = 7</div><div><br></div><div><br></div><div><br></div><div>or you can just leave it off entirely, and GHC will automatically infer the correct type (without you needing to import Data.Int):</div><div><br></div><div>dummy s = 7</div><div><br></div><br><div><div>On Nov 17, 2009, at 12:09 PM, michael rice wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Hi Daniel,<br>
<br>
Thanks for the IO monad reminder.<br>
<br>
What is GHC.Int.Int32? Can't find it on Hoogle.<br>
<br>
Michael<br>
<br>
==================<br>
<br>
*Main&gt; ht &lt;- new (==) dummy :: IO MyHashTable<br>
<br>
&lt;interactive&gt;:1:15:<br>
&nbsp;&nbsp;&nbsp; Couldn't match expected type `GHC.Int.Int32'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; against inferred type `Int'<br>
&nbsp;&nbsp;&nbsp; In the second argument of `new', namely `dummy'<br>
&nbsp;&nbsp;&nbsp; In a stmt of a 'do' expression:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ht &lt;- new (==) dummy :: IO MyHashTable<br>
*Main&gt; :t dummy<br>
dummy :: String -&gt; Int<br>
*Main&gt; <br>
<br><br><br>--- On <b>Tue, 11/17/09, Daniel Fischer <i>&lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Daniel Fischer &lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>&gt;<br>Subject: Re: [Haskell-cafe] Simple hash table creation<br>To: <a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>Date: Tuesday, November 17, 2009, 2:45 PM<br><br><div class="plainMail">Am Dienstag 17 November 2009 20:36:46 schrieb Daniel Fischer:<br>&gt; What you probably wanted was<br>&gt;<br>&gt; type MyHashTable = HashTable String Int -- not data MyHashTable<br>&gt;<br><br>Just in case it's not clear:<br><br>&gt; ht &lt;- new (==) dummy :: IO MyHashTable<br><br>only works at the prompt or in an IO do-block, not at the top level of the module.<br><br>&gt;<br>&gt; then ht is a hashtable of type MyHashTable.<br><br><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="x-msg://756/mc/compose?to=Haskell-Cafe@haskell.org">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></div></blockquote></td></tr></tbody></table><br>



      _______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></blockquote></div><br></body></html>