Undecideable instances for one instance?

Dear, Recently I was wrapping something in a typeclass (you may argue the reason for the typeclass, I will admit that's no longer needed, yet the compile error still begs questioning). Basically if you have only one global instance of a typeclass (so there is no overlapping), GHC will still complain about overlapping. Is there any reason this is so or is this a remnant of more complicated overlapping situations? The sample code is: {-# OPTIONS_GHC -fglasgow-exts #-} module Main where data Located a = L a class Locatable a where value :: Located a -> a wrap :: a -> Located a instance Locatable a where value (L a) = a wrap a = L a main :: IO () main = do print . value . wrap $ 1 -- Illegal instance declaration for `Locatable a' -- (There must be at least one non-type-variable in the instance head -- Use -fallow-undecidable-instances to permit this) -- In the instance declaration for `Locatable a' Christophe(vincenz) -- Christophe Poucet Ph.D. Student Phone:+32 16 28 87 20 E-mail: Christophe (dot) Poucet (at) imec (dot) be Website: http://notvincenz.com/ IMEC vzw – Register of Legal Entities Leuven VAT BE 0425.260.668 – Kapeldreef 75, B-3001 Leuven, Belgium – www.imec.be *****DISCLAIMER***** This e-mail and/or its attachments may contain confidential information. It is intended solely for the intended addressee(s). Any use of the information contained herein by other persons is prohibited. IMEC vzw does not accept any liability for the contents of this e-mail and/or its attachments. **********

Hello Christophe, Wednesday, June 7, 2006, 12:27:22 PM, you wrote:
global instance of a typeclass (so there is no overlapping), GHC will still complain about overlapping. Is there any reason this is so or is
GHC compains here about undecidability, not overlapping :)
-- Illegal instance declaration for `Locatable a' -- (There must be at least one non-type-variable in the instance head -- Use -fallow-undecidable-instances to permit this) -- In the instance declaration for `Locatable a'
Christophe(vincenz)
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Christophe! Wed, Jun 07, 2006 at 10:27:22AM +0200 you wrote:
The sample code is:
{-# OPTIONS_GHC -fglasgow-exts #-} module Main where
data Located a = L a
class Locatable a where value :: Located a -> a wrap :: a -> Located a
instance Locatable a where
You probably mean ``instance Locatable (Located a)'', don't you?
value (L a) = a wrap a = L a
HTH, -- DoubleF No virus detected in this message. Ehrm, wait a minute... /kernel: pid 56921 (antivirus), uid 32000: exited on signal 9 Oh yes, no virus:)

Hello Christophe! Wed, Jun 07, 2006 at 12:39:30PM +0400 I wrote:
instance Locatable a where
You probably mean ``instance Locatable (Located a)'', don't you?
Ouch, scratch that... -- DoubleF No virus detected in this message. Ehrm, wait a minute... /kernel: pid 56921 (antivirus), uid 32000: exited on signal 9 Oh yes, no virus:)
participants (3)
-
Bulat Ziganshin
-
Christophe Poucet
-
Sergey Zaharchenko