<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I think I know why I failed but in the manual, given these:</div><div class=""><br class=""></div><div class=""><font face="APL333" class=""><span style="font-style: normal;" class="">:- type thing ---> empty_thing ; thing_with_label(string).<br class="">:- type blob ---> empty_blob ; blob_with_label(string).</span></font></div><div class=""><font face="APL333" class=""><span style="font-style: normal;" class=""><br class=""></span></font></div><div class=""><font face="APL333" class=""><span style="font-style: normal;" class="">:- instance showable(thing) where [ ... ].<br class="">:- instance showable(blob) where [ ... ].</span></font><br class=""></div><div class=""><br class=""></div><div class="">I then tried to do this and got an error message which I was half-expecting. The problem is, I only half expected it!</div><div class=""><br class=""><font face="APL333" class=""><span style="font-style: normal;" class=""> P = (pred(X::in, !.IO::di, !:IO::uo) is det :-<br class=""> io.format("a thing: %s\n", [s(show(X))], !IO)<br class=""> ),<br class=""> list.foldl(P,<br class=""> [<br class=""> empty_thing,<br class=""> thing_with_label("Seems restricted to underlying type"),<br class=""> empty_blob,<br class=""> blob_with_label("Seems restricted to underlying type")<br class=""> ],<br class=""> !IO).</span></font></div><div class=""><br class=""></div><div class="">I have obviously mis-understood what I can do with a typeclass. So basically then, a list must be homogeneous by type, and providing a typeclass to group disparate types is not permissible because. I can see that from the code, I mean, it's obvious that there are two different types of things in the list but I somehow thought that it might work.</div><div class=""><br class=""></div><div class="">So, if I understand it correctly then, it failed because despite the typeclass forming a common API, namely `show`, this has absolutely no bearing on the fact that I still tried to create a non-homogeneous list ? I'd love to have a sensible interpretation of my half-brain attempt to do the above!</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Sean.</div><div class=""><br class=""></div><div class="">PS. Not sure if it's my imagination, but I upgraded to 20.01 and on my 10 year old iMac, compilation feels quicker, only by a shade, but maybe that's just me!</div><div class=""><br class=""></div><div class="">:)</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>