
17 Oct
2008
17 Oct
'08
9:31 a.m.
On Fri, Oct 17, 2008 at 2:21 PM, leledumbo
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 elements.
I hope to be enlightened, but I'm pretty sure this is not possible. Your readLn has to present a list of some specific type which can be inferred at compile time. Which type is it? String? Int? Something else? Also, neither Show nor Read relate to Ord, so you cannot ever be sure that all Readable/Showable types are Ordered, or that all Ordered types can be Read/Shown. D