Hi, dear ALL<div><br></div><div>I've found some thead about that (dated 1999)</div><div><br></div><div><a href="http://www.mercury.csse.unimelb.edu.au/mailing-lists/mercury-users/mercury-users.9905/0034.html">http://www.mercury.csse.unimelb.edu.au/mailing-lists/mercury-users/mercury-users.9905/0034.html</a></div>
<div><br></div><div>But despite the statement of usefullness of this feature:</div><div><br></div><div><a href="http://www.mercury.csse.unimelb.edu.au/mailing-lists/mercury-users/mercury-users.9905/0046.html">http://www.mercury.csse.unimelb.edu.au/mailing-lists/mercury-users/mercury-users.9905/0046.html</a></div>
<div><br></div><div>Seems, it's still not implemented.</div><div><br></div><div>I've wrote simple piece of code:</div><div><br></div><div><div>:- module tc1.</div><div><br></div><div>:- interface.</div><div><br></div>
<div>:- import_module io.</div><div><br></div><div>:- pred main(io::di, io::uo) is det.</div><div><br></div><div>:- implementation.</div><div><br></div><div>:- import_module int.</div><div><br></div><div>:- typeclass a(T) where [</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>func aaa(T) = T</div><div>].</div><div><br></div><div>:- instance a(int) where [</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>aaa(E) = E </div>
<div>].</div><div><br></div><div>:- type q(T) ---> q(T) <= a(T).</div><div><br></div><div>:- func z(q(T)) = T.</div><div>z(q(T)) = aaa(T).</div><div><br></div><div>main --> print(z(q(123))).</div></div><div><br></div>
<div>As you can see, it fails to compile:</div><div><br></div><div><div>D:\TEST\mercury>mmc.bat --make --infer-all tc1</div><div>Making Mercury\ints\<a href="http://tc1.int">tc1.int</a></div><div>tc1.m:021: In definition of type `tc1.q'/1:</div>
<div>tc1.m:021:   error: undefined type `a'/1.</div><div>`Mercury\ints\<a href="http://tc1.int">tc1.int</a>' not written.</div><div>** Error making `Mercury\ints\<a href="http://tc1.int">tc1.int</a>'.</div></div>
<div><br></div><div><br></div><div>Have you considered this feature useless/hard to implement?</div><div><br></div><div><br></div><div>Sincerely yours,</div><div>Vladimir</div>