hiding instance definitions in imported modules or redefining them, can it be done?

Is there a way to hide instance definitions when importing a module for instance I want to import Data.Monoid but wish to redefine the instance of Monoid for ( a->b) I don't suppose this is possible? Specifically, I wish to define a specialised instance of Monoid for String->Int, but it seems overlapping instances will not give me what I want, as this option seems to need to be applied at the definition site (aka Data.Monoid module, looking for confirmation of this?). The easy fix is just to do newtype M a b = M (a->b) etc..., but I was hopping to avoid this. I've encountered this issue several times. Why can't we redefine instances? I can't of thought that there are any seriouse technical issues in doing so? If so what are they? jvl

Is there a way to hide instance definitions when importing a module for instance
No, there isn't. See item 5.4: http://haskell.org/onlinereport/modules.html Best, Maurício
participants (2)
-
John Lask
-
Maurício