[Haskell] Read Instances for Data.Map and Data.Set
Ross Paterson
ross at soi.city.ac.uk
Wed Oct 26 18:58:10 EDT 2005
On Mon, Oct 24, 2005 at 02:58:03PM +0200, Tomasz Zielonka wrote:
> BTW, I noticed with slight horror that Data.Tree.Tree gained labeled
> fields in GHC 6.4, and of course they are included in the output of
> derived Show. This makes Tree's show'ed in 6.4 unreadable in earlier
> versions of GHC (like 6.2.2). Also, such represenation is too lenghty IMO.
>
> Perhaps rootLabel and subForest could be ordinary functions (but
> this could break someones code), or we could use a hand-written Show
> instance, showing without labels and reading both versions?
Sorry, I didn't think about Read. Maybe I should make them functions.
However it's quite common to define fields even when you only want the
extractor, especially with newtypes.
More information about the Libraries
mailing list