Sergey
This goes back to the discussion about how to get both the expressiveness
you want and decideable type inference. The rule about not having all
type variables in instance decls is to ensure that context reduction
terminates. The undecideable-instances flag lets you switch off this
check, as Sigbjorn says. What Haskell 2 should choose isn't clear, but
the experience you're accumulating of the usefulness of somehow relaxing
the default restriction is very useful.
Simon
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 19, 1998 1:33 PM
> To: [EMAIL PROTECTED]
> Subject: instance..=> L a a
>
>
> ghc-4 does not allow what ghc-3.02 did:
>
>
> class ...=> MulSemigroup a where mul :: a -> a -> a
> ...
> class (AddGroup a,MulSemigroup a) => Ring a where ...
>
> class (Ring r,AddGroup a) => LeftModule r a where
> cMul :: r -> a -> a
>
instance Ring a => LeftModule a a where cMul = mul
>
>
> ghc-4 says
> Illegal instance declaration for `LeftModule a a'
> (There must be at least one non-type-variable in the instance head)
>
> If Haskell-2 is going to be this way, then this is somehow against the
> needs of algebra.
>
> ghc developers, please, advise.
>
>
> ------------------
> Sergey Mechveliani
> [EMAIL PROTECTED]
>