[EMAIL PROTECTED] reports the following problem.
Version: 1.3c
OS: Windows 95
compiler: precompiled binaries
configuration: +stfewkoui -gl. -h28000 -p"? " -r$$
Expected behaviour:
A datatype deriving the classes Show and Read
should allow for reading a string produced by show.
Observed behaviour:
Automatic derivation does not work.
If showsPrec and read are explicitely defined, it works.
The same applies for patched version (1.3c p1).
It works in Hugs1.4 (June 1998), but I need multi-parameter
classes.
Transcript:
? p1
P "John" :: Person
(101 reductions, 143 cells)
? p2
Program error: Undefined member: readsPrec
(1 reduction, 19 cells)
?
Code:
-- testRead.hs
-- testing derived read
data Person = P String deriving (Eq, Ord, Read, Show)
p1 :: Person
p1 = P "John"
output:: String
output = show p1
p2 :: Person
p2 = read output :: Person
main = putStr.show $ p2