Proposal for stand-alone deriving declarations?

Bulat Ziganshin bulat.ziganshin at
Thu Nov 2 02:56:06 EST 2006

Hello Brian,

Thursday, November 2, 2006, 12:15:38 AM, you wrote:

> In particular, I think having features like :
>      import M1 hiding (instance C T)
> and
>     module M hiding (instance C T)
> would eliminate the need for special-case handling of derived
> instances (if two imported modules happen to derive the same
> instances, you can just hide the instances from one of them).
> Instance hiding is an important feature in its own right. 

i vote for this feature too. in my AltBinary library, there are many
different ways to serialize strings, for example. i want to provide
default "instance Binary String" for quick&dirty use and ability to
hide just this instance in the case when user need to overwrite it.
now i forced to put all instance declarations in separate file and
suggest user to copy this file into his project and make appropriate

also, expicit instance imports was in prewvious Haskell versions. so i
think it will be great to use implicit importing of all instances by
default but allow to hide all instances or specific instance and
import just the instance required:

import M (instance Binary String)  -- hides all other Binary instances
module M hiding (instance Binary)  -- hides all Binary instances

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at

More information about the Haskell-prime mailing list