instance overlap in 6.6 candidate

Ian Lynagh igloo at earth.li
Mon Sep 4 10:47:13 EDT 2006


On Mon, Sep 04, 2006 at 06:22:34PM +0400, Serge D. Mechveliani wrote:
> 
> 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 =  <certain program which prints a list of equation
>                       in a `nicer' way than by the default list printing
>                      >

This doesn't addrses the general issue, but in this case you can say

data Equation = ...
instance Show Equation where
    showsPrec _ eq = ...
    showList eqs = <certain program which ...>


Thanks
Ian



More information about the Glasgow-haskell-users mailing list