Thanks, this explanation is what I was looking for.&nbsp;&nbsp; Wikipeidia has an explanation on it also:<br><br><a href="http://en.wikipedia.org/wiki/System_F#System">http://en.wikipedia.org/wiki/System_F#System</a><br><br>daryoush<br>
<br><div class="gmail_quote">On Wed, Feb 18, 2009 at 2:08 AM, Stephan Friedrichs <span dir="ltr">&lt;<a href="mailto:deduktionstheorem@web.de">deduktionstheorem@web.de</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;">
<div><div></div><div class="Wj3C7c">Daryoush Mehrtash wrote:<br>
&gt; Is there a way to define a type with qualification on top of existing<br>
&gt; type (e.g. &nbsp;prime numbers)? &nbsp; Say for example I want to define a<br>
&gt; computation that takes a prime number and generates a string. &nbsp; Is there<br>
&gt; any way I can do that in Haskell?<br>
<br>
</div></div>Haskell&#39;s type system is decidable, so you can&#39;t let the type system<br>
check arbitrary properties. It probably is possible in C++ by some<br>
template hack (C++ templates are Turing complete), but not in Haskell.<br>
But, as mentioned in the other responses, you can<br>
<br>
&nbsp;- use a representation that makes it impossible to use wrong values<br>
 &nbsp; (-&gt; Ketil&#39;s n-th prime representation)<br>
<br>
&nbsp;- check values at runtime (-&gt; Luke&#39;s repsonse)<br>
<br>
//Stephan<br>
<font color="#888888"><br>
--<br>
<br>
Früher hieß es ja: Ich denke, also bin ich.<br>
Heute weiß man: Es geht auch so.<br>
<br>
&nbsp;- Dieter Nuhr<br>
</font><div><div></div><div class="Wj3C7c">_______________________________________________<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><br clear="all"><br>