If a newbie considers this as something natural, this is another reason for syntactic sugaring of HList:<div><br></div><div><a href="http://www.haskell.org/pipermail/haskell-cafe/2011-April/090986.html">http://www.haskell.org/pipermail/haskell-cafe/2011-April/090986.html</a><br>

<br><div class="gmail_quote">2011/10/2 Du Xi <span dir="ltr">&lt;<a href="mailto:sdiyazg@sjtu.edu.cn">sdiyazg@sjtu.edu.cn</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

--I tried to write such polymorphic function:<br>
<br>
expand (x,y,z) = (x,y,z)<br>
expand (x,y) = (x,y,1)<br>
<br>
--And it didn&#39;t compile. Then I added a type signature:<br>
<br>
expand::a-&gt;b<br>
expand (x,y,z) = (x,y,z)<br>
expand (x,y) = (x,y,1)<br>
<br>
--It still didn&#39;t compile. I think the reason is that the following is disallowed:<br>
<br>
f::a-&gt;b<br>
f x = x<br>
<br>
--Is it possible to get around this and write the &quot;expand&quot; function? Of course, x and y may be of different types<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div>