Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Corey O'Connor
Not just a proposal any more. :-) GHC 7.0 does not generalize local let bindings in some situations. See here for information: http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7 There is a proposal (from Big Simon) to remove let-generalization:

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread MigMit
Yeah, seems to work too. Отправлено с iPhone Jun 20, 2011, в 10:55, Corey O'Connor coreyocon...@gmail.com написал(а): Not just a proposal any more. :-) GHC 7.0 does not generalize local let bindings in some situations. See here for information:

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Serguey Zefirov
The fact is that (Num a) context works and (ToWires a, Num a) context doesn't. At least in 6.12.1. This still looks to me like a bug. 2011/6/19 Miguel Mitrofanov miguelim...@yandex.ru: Seems like let-generalization is at work here. Types of all values in the where section are inferred

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread David Menendez
GHC 6.12 introduces MonoLocalBinds, which disables polymorphic values in let statements. Your original code works for me if I use -XNoMonoLocalBinds -XNoMonomorphismRestriction. On Mon, Jun 20, 2011 at 9:02 AM, Serguey Zefirov sergu...@gmail.com wrote: The fact is that (Num a) context works and

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Serguey Zefirov
Thank you very much. I'll try that too. 2011/6/20 David Menendez d...@zednenem.com: GHC 6.12 introduces MonoLocalBinds, which disables polymorphic values in let statements. Your original code works for me if I use -XNoMonoLocalBinds -XNoMonomorphismRestriction. On Mon, Jun 20, 2011 at 9:02

Re: [Haskell-cafe] Probably type checker error.

2011-06-20 Thread Miguel Mitrofanov
Defaulting. Inferred type of r is still polymorphic – r :: E ins outs – but type of x, nextSum and currentSum is defaulted to Integer. Try adding default () to your program, and you'll see the same error again. Or, if you enable NoMonomorphismRestriction (or MonoLocalBinds – I didn't know it

Re: [Haskell-cafe] Probably type checker error.

2011-06-19 Thread Serguey Zefirov
Cool. It works. Thank you very much! 2011/6/19 Miguel Mitrofanov miguelim...@yandex.ru: Seems like let-generalization is at work here. Types of all values in the where section are inferred basically as if they are declared at the top level. Therefore, inheritance fails without

Re: [Haskell-cafe] Probably type checker error.

2011-06-19 Thread Miguel Mitrofanov
Seems like let-generalization is at work here. Types of all values in the where section are inferred basically as if they are declared at the top level. Therefore, inheritance fails without NoMonomorphismRestriction. There is a proposal (from Big Simon) to remove let-generalization: