Re: Weird Undecidable Instances Bug

2003-09-10 Thread Martin Sulzmann
original, g is actually a method in a class, and its definition is in an instance declaration. Its type is actually given, not annotated. For instance: Ah, g is meant to be a method. Well, ... -- ghc -fglasgow-exts -fallow-undecidable-instances -c WeirdInsts.hs module WeirdInsts

Re: Weird Undecidable Instances Bug

2003-09-09 Thread Ashley Yakeley
On Monday, Sep 8, 2003, at 03:53 US/Pacific, Simon Peyton-Jones wrote: Consider an instance decl like: instance (Lte a b l,If l b a c) = Max a b c (This is a real example.) Notice that l is used on the LHS of the = but not the RHS. The idea is that l will get unified by a functional

Re: Weird Undecidable Instances Bug

2003-09-09 Thread Martin Sulzmann
Simon said This is a tricky one. Here's what is going on. I believe there's nothing tricky going on. Your type annotation g :: (F a b,D b (T r)) = (a,T r) g = f is simply incorrect. Keep in mind that GHC does NOT improve type annotations. For example, g :: (F a b, C (T r)) = (a,T r) g =

Re: Weird Undecidable Instances Bug

2003-09-09 Thread Ashley Yakeley
On Tuesday, Sep 9, 2003, at 00:40 US/Pacific, Martin Sulzmann wrote: Your type annotation g :: (F a b,D b (T r)) = (a,T r) g = f is simply incorrect. I must say I don't understand. I need a value of that type. In the original, g is actually a method in a class, and its definition is in an

Weird Undecidable Instances Bug

2003-09-08 Thread Ashley Yakeley
This fails to compile. Oddly enough, if you remove the instance declaration (1), or if you remove the r parameter to T, or if you do any of the other simplifications I've tried, it compiles successfully. -- ghc -fglasgow-exts -fallow-undecidable-instances -c WeirdInsts.hs module WeirdInsts