Hello Bulat,

You are indeed correct. However I fail to see how there is any undecideability.  If instead one specified it as follows, it would be fine:

class Locatable a b | a -> b, b -> a where
   value :: a -> b
   wrap :: b -> a

instance Locatatable (Located a) a where

   value (L a) = a
   wrap a       = L a

It compiles fine, yet this is semantically the same.




On 6/7/06, Bulat Ziganshin <bulat.ziganshin@gmail.com> wrote:
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