<div dir="ltr"><br><div><br><br><div class="gmail_quote">On Fri, Oct 17, 2008 at 6:21 AM, leledumbo <span dir="ltr">&lt;<a href="mailto:leledumbo_cool@yahoo.co.id">leledumbo_cool@yahoo.co.id</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
So, what&#39;s the solution? This one:<br>
<br>
(l::[Ord]) &lt;- readLn<br>
<br>
doesn&#39;t work (because Ord isn&#39;t a type constructor). It doesn&#39;t even comply<br>
to Haskell 98 standard. I want to be able to read any list of ordered<br>
elements.</blockquote><div><br></div><div>The problem is one of decoding data from a data source. &nbsp;This is usually handled with parsers. &nbsp;Neither static nor dynamic typing could really save you here, unless the file is written out in a format that could be automatically parsed by the input. &nbsp;(like S-expressions perhaps for a lisp read call...)<div>
<br></div><div>If it was as easy as your code would like it to be, people wouldn&#39;t have bothered with things like XDR, XML, ASN.1 (BER) etc. &nbsp;They&#39;d just send binary data everywhere. &nbsp;How can you tell a 32bit value from four 8 bit bytes for instance?&nbsp;</div>
<div><br></div><div>You must parse I think.</div></div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/List-as-input-tp19987726p20033244.html" target="_blank">http://www.nabble.com/List-as-input-tp19987726p20033244.html</a><br>
</font><div class="Ih2E3d">Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">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></div></div>