want better error msg with Class Read

Johannes Waldmann joe@isun.informatik.uni-leipzig.de
Thu, 7 Nov 2002 19:39:56 +0100 (MET)


thanks for the suggestions along the lines of

> Why not just define your own function, much like `read`, that produces a
> more suitable error message?

but in this case, I can't change the names and types
(since the code is used by students in assignments that are already running)

also, I want to use standard (i. e. Prelude) functions and classes as far 
as possible. (otherwise, students will ask what the Prelude is good for :-)
For some types, I have a Parsec parser,
but for others I just do `deriving Read'. 
(So the derived parsers possibly call the Parsec parsers.)

Let me repeat that I would welcome 
if `read' was a class method, instead of a function. 
I mentioned that `show' is a Show method nowadays,
while it was a function in Haskell-1.4. What were the reasons to change this?
Does my example count as a reason
to do a similar change for `read' at some point in the future?

best regards,
-- 
-- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ --
-- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/207 --