
4 Apr
2006
4 Apr
'06
12:46 p.m.
Benjamin Franksen wrote:
However, it would help programmers a lot, specialy library users. And it would lift some of the burden that is currently on the library writer to never forget to derive all possibly useful instances for public data types.
If you allow 'deriving' in other modules it can violate the 'privacy' of modules. For example (if these instances were not declared):
deriving Data.Map.Map (Show)
Now I can look at what map nodes look like.
deriving Data.Map.Map (Data)
Now I can even mess with the internal structure, violating invariants. Twan