Re: instance inference

2006-02-06 Thread Ross Paterson
A patch implementing a relaxed termination constraint is at http://www.soi.city.ac.uk/~ross/instance-termination.patch Here is the description: With -fglasgow-exts but not -fallow-undecidable-instances, GHC 6.4 requires that instances be of the following form: (1) each assertion

RE: instance inference

2006-02-06 Thread Simon Peyton-Jones
Ross, and Martin, Thanks! But I'm not certain that your fix is correct. Let's ask Martin. I've added comments below. | -Original Message- | From: [EMAIL PROTECTED] [mailto:glasgow-haskell-users- | [EMAIL PROTECTED] On Behalf Of Ross Paterson | Sent: 06 February 2006 11:36 | To: Simon

Re: instance inference

2006-02-06 Thread Ross Paterson
On Mon, Feb 06, 2006 at 11:53:17AM -, Simon Peyton-Jones wrote: Thanks! But I'm not certain that your fix is correct. Let's ask Martin. I've added comments below. [...] Yes, (1-GHC) certainly contradicts the FD paper that Martin and I wrote. I think (1) should be: (1-fixed)

Re: instance inference

2006-02-06 Thread Ross Paterson
On Mon, Feb 06, 2006 at 12:07:54PM +, Ross Paterson wrote: On Mon, Feb 06, 2006 at 11:53:17AM -, Simon Peyton-Jones wrote: Your (1-Ross) ensures that every variable in the assertion does occur in the head. But I'm not sure that the size-reduction argument is watertight in the

RE: instance inference

2006-02-06 Thread Simon Peyton-Jones
| Yes, (1-GHC) certainly contradicts the FD paper that Martin and I wrote. | I think (1) should be: | | (1-fixed) Each assertion in the context must constrain type | variables, and | those type variables must all be mentioned in the head. | | That is, there is no requirement that the

Re: instance inference

2006-02-06 Thread Doaitse Swierstra
I have not followed this completely, but do these new rules now allow: class F a b c where f: a - b - c and then instance F a a a where ... which gives currenly gives (using -fglasgow-exts): Test.hs:6:0: Illegal instance declaration for `F a a a' (There must be at least one

Re: instance inference

2006-02-06 Thread Ross Paterson
On Mon, Feb 06, 2006 at 01:53:17PM +0100, Doaitse Swierstra wrote: I have not followed this completely, but do these new rules now allow: class F a b c where f: a - b - c and then instance F a a a where Yes. Indeed they allow any unconstrained instance. They would also allow

RE: instance inference

2006-02-06 Thread Simon Peyton-Jones
| I have not followed this completely, but do these new rules now allow: | | class F a b c where |f: a - b - c | | instance F a a a where Ross's proposal would allow that. Ignore functional dependencies for the moment. To force instance inference to terminate we need the context of the

RE: Lexically scoped type variables

2006-02-06 Thread Simon Peyton-Jones
I took a look. Here's a typical example: newVariableListFromSet :: Ord a = VariableSetSource a - VariableList a newVariableListFromSet (variableSetSource :: VariableSetSource a) = let attachListOp parallelX (listDrawer :: ListDrawer a pos) = do (posRegistry ::

Re: Lexically scoped type variables

2006-02-06 Thread Christian Maeder
Simon Peyton-Jones wrote: I took a look. Here's a typical example: newVariableListFromSet :: Ord a = VariableSetSource a - VariableList a newVariableListFromSet (variableSetSource :: VariableSetSource a) = let attachListOp parallelX (listDrawer :: ListDrawer a pos) = do

RE: Lexically scoped type variables

2006-02-06 Thread Simon Peyton-Jones
| That was exactly my problem. How should I find out the type of | attachListOp (I have not written this bit of code)? Could I somehow ask | ghci-6.4.1 to do it for me? (Unsatisfactory but would work) You could compile with -ddump-ds and look at the output. Simon

Re: bug in compacting GC

2006-02-06 Thread Simon Marlow
Bulat Ziganshin wrote: Hello , yes, i found this famous -c bug! the humor of situation is what easiest way to got this bug is to run ghc itself! :) it seems that noone except me tried this ever. i just found that any large enough module raises this error!!! that, for example, results of

Re: Lexically scoped type variables

2006-02-06 Thread Christian Maeder
Simon Peyton-Jones wrote: (Unsatisfactory but would work) You could compile with -ddump-ds and look at the output. Yes, I did work (for VariableList.hs) attachListOp :: forall pos . ParallelExec - ListDrawer a pos - IO (IO ()) Thanks, Christian (I need to get a new ghc-6.5 without the

Re[2]: instance inference

2006-02-06 Thread Bulat Ziganshin
Hello Ross, Monday, February 06, 2006, 2:35:40 PM, you wrote: RP A patch implementing a relaxed termination constraint is at RP http://www.soi.city.ac.uk/~ross/instance-termination.patch [this patch provides the following:] RP With -fglasgow-exts but not -fallow-undecidable-instances

Re[2]: [GHC] #649: class declaration accepts conop as method name

2006-02-06 Thread Bulat Ziganshin
Hello GHC, Monday, February 06, 2006, 7:59:24 PM, you wrote: G #649: class declaration accepts conop as method name G Type: bug | Status: closed G Fixed in HEAD but wont't fix in 6.4.2 why you are not fixing this bug in 6.4.2? imho, we need to have more stable GHC