<div dir="ltr"><br><div><br><br><div class="gmail_quote">On Fri, Oct 17, 2008 at 6:21 AM, leledumbo <span dir="ltr"><<a href="mailto:leledumbo_cool@yahoo.co.id">leledumbo_cool@yahoo.co.id</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
So, what's the solution? This one:<br>
<br>
(l::[Ord]) <- readLn<br>
<br>
doesn't work (because Ord isn't a type constructor). It doesn'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. This is usually handled with parsers. 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. (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't have bothered with things like XDR, XML, ASN.1 (BER) etc. They'd just send binary data everywhere. How can you tell a 32bit value from four 8 bit bytes for instance? </div>
<div><br></div><div>You must parse I think.</div></div><div> </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>