Is Read / Show for serialization or pretty printing?

HAppS development during the ghc6.4 era required Read/Show for serialization, and binary serialization isn't yet popular for HAppS. Because of that, SURI.hs (Show URI) was added to HAppS to wrap Network.URI. I vaguely recall that Network.URI's Show instance was rewritten for GHC 6.6, but the current instance is more for pretty-printing than serialization. To make a long story short, Network.URI does not use derived Read and Show instances, and that causes problems when trying to get invertible serialization. The fix in our opinion is to switch to derived Read and Show instances for Network.URI. Shae & Lemmih -- I've tried to teach people autodidactism, | ScannedInAvian.com but it seems they always have to learn it for themselves.| Shae Matijs Erisson

shae:
HAppS development during the ghc6.4 era required Read/Show for serialization, and binary serialization isn't yet popular for HAppS.
Because of that, SURI.hs (Show URI) was added to HAppS to wrap Network.URI.
I vaguely recall that Network.URI's Show instance was rewritten for GHC 6.6, but the current instance is more for pretty-printing than serialization.
To make a long story short, Network.URI does not use derived Read and Show instances, and that causes problems when trying to get invertible serialization.
The fix in our opinion is to switch to derived Read and Show instances for Network.URI.
Shae & Lemmih
And there's already a rule that all Read/Show instances be invertible. If read . show doesn't work for URI, it is broken. -- Don

Shae Matijs Erisson wrote:
HAppS development during the ghc6.4 era required Read/Show for serialization, and binary serialization isn't yet popular for HAppS.
Because of that, SURI.hs (Show URI) was added to HAppS to wrap Network.URI.
I vaguely recall that Network.URI's Show instance was rewritten for GHC 6.6, but the current instance is more for pretty-printing than serialization.
To make a long story short, Network.URI does not use derived Read and Show instances, and that causes problems when trying to get invertible serialization.
The fix in our opinion is to switch to derived Read and Show instances for Network.URI.
Yes, Read and Show should be for serialisation. We should really have a separate class for pretty printing. Please submit a bug report against Network.URI. Cheers, Simon
participants (4)
-
dons@cse.unsw.edu.au
-
Henning Thielemann
-
Shae Matijs Erisson
-
Simon Marlow