<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">And I thought everyone was puzzling these type signatures out all by themselves. ;-)<br><br>The Haskell learning curve is about the steepest I've ever seen for a computer language, but I think I'm catching on.<br><br>Thanks for the info.<br><br>Michael<br><br><br>--- On <b>Thu, 5/28/09, wren ng thornton <i>&lt;wren@freegeek.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: wren ng thornton &lt;wren@freegeek.org&gt;<br>Subject: Re: [Haskell-cafe] What's the problem with iota's type signature?<br>To: "Haskell-cafe" &lt;haskell-cafe@haskell.org&gt;<br>Date: Thursday, May 28, 2009, 11:14 PM<br><br><div class="plainMail">michael rice wrote:<br>&gt; Yeah, I went back and tried double again, though I'd swear I got the dang thing to compile&nbsp; (and run) w/o errors.<br>&gt; <br>&gt; I
 guess I meant Num. So Num is a class and Int and Integer are types? What are the other classes? Docs?<br>&gt; <br>&gt; Unification, for me, is pattern matching ala Prolog. What's the meaning in Haskell? Docs?<br>&gt; <br>&gt; I've been digging into this stuff for months and it's still tripping me up. Very frustrating.<br><br><br>As others have mentioned, using GHCi can give you a lot of information. GHCi commands begin with a colon followed by the command (kinda like vi), whereas anything not beginning with a colon is treated as a Haskell expression to be evaluated. The :? command will list all the GHCi commands, which is a good place to start.<br><br>The :type command takes a Haskell expression and prints the type inferred for it. You can also use the command ":set +t" which will make GHCi print the type after evaluating each expression; you may want to use this until you get the hang of things. The :info command takes a whitespace separated list of
 identifiers and will print their type and other information (e.g. what module it comes from, what type class a function belongs to, all the functions that are members of a type class, fixity of operators,...)<br><br><br>As far as type classes and the like, there are a bunch. Hoogle[1] is an excellent API search engine for looking up this kind of stuff. Just enter the name of a function, type class, data type, or enter a type signature. The results give links to the online Haddock documentation (either GHC official docs, or Hackage docs).<br><br><br>Unification is used when doing type inference. It's the same unification as in Prolog, only at the type level. Because of the way inference works, it happens that the |a| and |b| type variables must be unified for both of the functions you gave. A whole lot more can be said here, though I'm not sure how much you care :)&nbsp; The Wikipedia page on Hindley--Milner[2] gives a good starting point, though
 Haskell's type inference has more bells and whistles than the basic HM algorithm.<br><br><br>[1] <a href="http://haskell.org/hoogle/" target="_blank">http://haskell.org/hoogle/</a><br>[2] <a href="http://en.wikipedia.org/wiki/Hindley-Milner" target="_blank">http://en.wikipedia.org/wiki/Hindley-Milner</a><br><br>-- Live well,<br>~wren<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="/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></table><br>