<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">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><br>I guess I meant Num. So Num is a class and Int and Integer are types? What are the other classes? Docs?<br><br>Unification, for me, is pattern matching ala Prolog. What's the meaning in Haskell? Docs?<br><br>I've been digging into this stuff for months and it's still tripping me up. Very frustrating.<br><br>Thanks.<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,
 12:40 AM<br><br><div class="plainMail">michael rice wrote:<br>&gt; Still exploring monads. I don't understand why the type signature for double is OK,<br><br>It isn't. The |a| and |b| variables must unify:<br><br>&nbsp; &nbsp; Prelude&gt; :t \x -&gt; Just (x+x)<br>&nbsp; &nbsp; \x -&gt; Just (x+x) :: (Num a) =&gt; a -&gt; Maybe a<br><br>&nbsp; &nbsp; Prelude&gt; :t (\x -&gt; Just (x+x)) :: Num a =&gt; a -&gt; Maybe b<br>&nbsp; &nbsp; &lt;interactive&gt;:1:13:<br>&nbsp; &nbsp; &nbsp; &nbsp; Couldn't match expected type `b' against inferred type `a'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `b' is a rigid type variable bound by<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the polymorphic type `forall a b. (Num a) =&gt; a -&gt; Maybe b'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; at &lt;interactive&gt;:1:0<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; `a' is a rigid type variable bound by<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the
 polymorphic type `forall a b. (Num a) =&gt; a -&gt; Maybe b'<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; at &lt;interactive&gt;:1:0<br>&nbsp; &nbsp; &nbsp; &nbsp; In the first argument of `Just', namely `(x + x)'<br>&nbsp; &nbsp; &nbsp; &nbsp; In the expression: Just (x + x)<br><br><br>&gt; but not the one for iota.<br><br>Again the |a| and |b| must unify.<br>Also, Int isn't a type class (did you mean Num?)<br>Also, the use of (..) requires the Enum class.<br><br>&nbsp; &nbsp; Prelude&gt; :t \n -&gt; [1..n]<br>&nbsp; &nbsp; \n -&gt; [1..n] :: (Enum t, Num t) =&gt; t -&gt; [t]<br><br>&nbsp; &nbsp; Prelude&gt; [3,4,5] &gt;&gt;= (\n -&gt; [1..n])<br>&nbsp; &nbsp; [1,2,3,1,2,3,4,1,2,3,4,5]<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>