[Haskell-cafe] List as input
leimy2k at gmail.com
Fri Oct 17 09:42:48 EDT 2008
On Fri, Oct 17, 2008 at 6:21 AM, leledumbo <leledumbo_cool at yahoo.co.id>wrote:
> So, what's the solution? This one:
> (l::[Ord]) <- readLn
> doesn't work (because Ord isn't a type constructor). It doesn't even comply
> to Haskell 98 standard. I want to be able to read any list of ordered
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
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?
You must parse I think.
> View this message in context:
> Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe