Is Read / Show for serialization or pretty printing?

Donald Bruce Stewart dons at
Sat Mar 3 20:28:07 EST 2007

> 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

More information about the Libraries mailing list