Skip to content

Automatically derived Read of operator is not inverse of automatically derived Show

This program fails as shown below using ghc 6.13 snapshot 20100519

data T = (:=:) | (:!=:) deriving (Show,Read)

main = 
  putStrLn ("show (:=:) = " ++ show (:=:)) >>
  putStrLn ("read (show (:=:)) :: T = " ++
            show (read (show (:=:)) :: T))

Result:

> main
show (:=:) = :=:
read (show (:=:)) :: T = *** Exception: Prelude.read: no parse
Trac metadata
Trac field Value
Version 6.13
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information