Here&#39;s the difference between these two types:<br><br>test1 :: forall a. a -&gt; Int<br>-- The caller of test1 determines the type for test1<br>test2 :: (forall a. a) -&gt; Int<br>-- The internals of test2 determines what type, or types, to instantiate the argument at<br>
<br>Or, to put it another way, since there are no non-bottom objects of type (forall a. a):<br>test1 converts *anything* to an Int.<br>test2 converts *nothing* to an Int<br><br>-- type-correct implementation<br>-- instantiates the (forall a. a) argument at Int<br>
test2 x = x<br><br>-- type error, the caller chose &quot;a&quot; and it is not necessarily Int<br>-- test1 x = x<br><br>-- type-correct implementation: ignore the argument<br>test1 _ = 1<br><br>  -- ryan<br><br><div class="gmail_quote">
On Wed, Sep 16, 2009 at 1:04 AM, Cristiano Paris <span dir="ltr">&lt;<a href="mailto:frodo@theshire.org">frodo@theshire.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Sep 15, 2009 at 11:38 PM, Daniel Fischer<br>
&lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>&gt; wrote:<br>
&gt; ...<br>
<div class="im">&gt;&gt; foo :: forall a. a -&gt; a<br>
&gt;<br>
&gt; This is exactly the same type as<br>
&gt;<br>
&gt; foo :: a -&gt; a<br>
&gt;<br>
&gt; (unless you&#39;re using ScopedTypeVariables and there&#39;s a type variable a in scope), since<br>
&gt; type signatures are implicitly forall&#39;d.<br>
<br>
</div>Yep, perhaps I used the wrong example. What about foo: (forall a. a) -&gt; Int?<br>
<div><div></div><div class="h5"><br>
Cristiano<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto: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></div></blockquote></div><br>