
To my request on overlapping instances in 6.6 candidate
Simon Peyton-Jones
[..]
GHC 6.6's story is that an instance declaration can only be overlapped if you compile that module with -fallow-overlapping-instances. Since the list instance for Show was not compiled in this way, you can't overlap it.
You may think this is annoying -- but it does mean that you can look at an instance declaration and see whether it might be overlapped, just by look at the flags for that module.
But why to restrict the user, why one needs to detect which library
instance can be overlapped? Why not to allow all of them to overlap?
Here is an example of how I alayws was using overlaps with standard
instances.
------------------------------------------------
data Equation = ...
instance Show Equation where ...
instance Show [Equation]
where
showsPrec _ eqs =