Hi,<br><br><div class="gmail_quote"><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>&gt; I just found out that it *is* possible to implement the inside function,<br>


&gt; namely as follows:<br>
&gt;<br>
&gt; &gt; inside :: forall t. ((forall a. Wrapper (t a))-&gt; Wrapper (forall a. (t<br>
&gt; &gt; a)))<br>
&gt; &gt; inside x = Wrapper f<br>
&gt; &gt; &nbsp; where f :: forall a. (t a)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; f = unwrap x<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; unwrap (Wrapper z) = z<br>
&gt;<br>
&gt; I guess this solves my problem. Sorry for bothering you with this question.<br>
&gt; I still find it a bit weird to write all these obfuscated identity functions<br>
&gt; to make the type checker happy, though.<br>
<br>
</div>As I said, the types are not isomorphic -- it you think of type<br>
parameters as arguments you will see why.</blockquote></div><div><br>I found these examples interesting, mostly because I don&#39;t understand it very well. So, I simplified Klaus&#39; code a bit and derived the following:<br>

<br>-----<br>{-# LANGUAGE Rank2Types #-}<br><br>-- Wrapper<br>newtype W a = W { unW :: a }<br><br>inside :: ((forall a. W (t a))-&gt; W (forall a. (t a)))<br>--inside (W x) = W x -- (a) FAILS<br>--inside = W . unW -- (b) FAILS<br>

inside x = W (unW x) -- (c) WORKS<br>-----<br><br>Can someone comment on the differences between the following in terms of type-checking or inference? Considering the errors I got, I&#39;m guess the issue is the same for the pattern-matching (a) and the point-free (b) versions. Are there any pointers for developing a better understanding or intuition of this?<br>

<br>Thanks,<br>Sean<br></div></div>
</div>