[Haskell] Read Instances for Data.Map and Data.Set

David Sankel camior at gmail.com
Fri Oct 21 19:22:31 EDT 2005

On 10/19/05, Georg Martius <mai99dgf at studserv.uni-leipzig.de> wrote:
> I was really annoyed by the fact that for Data.Map and Data.Set are no Read
> instances declared, but Show instances are! I believe there should be some
> kind of unwritten rule that in the standart lib the Show and Read instances
> come pairwise and are fully compatible.

If there was this unwritten rule, should there not be other rules
designed to ensure that reads and shows with interacting types are
compatible? For example, I could imagine a type that would read and
show on it's own, but a map of these objects wouldn't read and show

I'm not suggesting this, but a possible solution would be to use
parenthesis around every type and disallow a type to show to unmatched
internal parenthesis.



More information about the Haskell mailing list