Show instance in System.Event.Manager causes conflicts

System.Event.Manager [1] contains the following type alias and Show instance: -- | Callback invoked on I/O events. type IOCallback = FdKey -> Event -> IO () instance Show IOCallback where show _ = "IOCallback" This specialized instance conflicts with the more general instance Show (a -> b) defined in Text.Show.Functions. Stefan found this conflict when trying to compile the checkers package on ghc 7.0.3. I suspect it will arise with other packages as well. My suggestion is to remove the specialized Show instance and instead import Text.Show.Functions as needed. Other thoughts? [1] http://hackage.haskell.org/packages/archive/base/4.3.1.0/doc/html/src/System... - Conal

On Mon, Apr 4, 2011 at 12:18 PM, Conal Elliott
System.Event.Manager [1] contains the following type alias and Show instance:
-- | Callback invoked on I/O events. type IOCallback = FdKey -> Event -> IO ()
instance Show IOCallback where show _ = "IOCallback"
This specialized instance conflicts with the more general instance Show (a -> b) defined in Text.Show.Functions.
Stefan found this conflict when trying to compile the checkers package on ghc 7.0.3. I suspect it will arise with other packages as well.
My suggestion is to remove the specialized Show instance and instead import Text.Show.Functions as needed.
Other thoughts?
Is there a reason that this instance is orphaned? Can we make it non-orphaned, so that we don't run into this problem again? This would require putting the instance into the Prelude. Antoine

On Mon, Apr 4, 2011 at 10:18 AM, Conal Elliott
My suggestion is to remove the specialized Show instance and instead import Text.Show.Functions as needed.
I don't think that instance needs to be there at all; it's just a holdover from in-progress debugging. So rather than import Text.Show.Functions, just get rid of it.

On 4 April 2011 19:50, Bryan O'Sullivan
On Mon, Apr 4, 2011 at 10:18 AM, Conal Elliott
wrote: My suggestion is to remove the specialized Show instance and instead import Text.Show.Functions as needed.
I don't think that instance needs to be there at all; it's just a holdover from in-progress debugging. So rather than import Text.Show.Functions, just get rid of it.
Since I was working in the event manager anyway I quickly created a patch for it: http://hackage.haskell.org/trac/ghc/ticket/5092 Cheers, Bas
participants (4)
-
Antoine Latter
-
Bas van Dijk
-
Bryan O'Sullivan
-
Conal Elliott