Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-11 Thread Erik Hesselink
That makes sense: MonomorphismRestriction makes bindings without parameters monomorphic, and MonoLocalBinds makes local bindings monomorphic. So either one will make this binding monomorphic. Only when both are off does it become polymorphic and does the error occur. Erik On Sun, Nov 11, 2012 at

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-11 Thread Roman Cheplyaka
Right. What I meant is that with -XMonomorphismRestriction, it compiles with with both -XMonoLocalBinds and -XNoMonoLocalBinds. That means that MonoLocalBinds can not be solely responsible for this behaviour. Anyway, I just noticed that a very similar example (using Read) is described in the Hask

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-11 Thread Erik Hesselink
That's strange. Here, it only fails with both NoMonomorphismRestriction and NoMonoLocalBinds (which makes sense). I've tested on 7.4.1 and 7.6.1. Erik On Sun, Nov 11, 2012 at 3:54 PM, Roman Cheplyaka wrote: > Apparently not — the code comilers with any of -XNoMonoLocalBinds and > -XMonoLocalBi

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-11 Thread Roman Cheplyaka
Apparently not — the code comilers with any of -XNoMonoLocalBinds and -XMonoLocalBinds, but not with -XNoMonomorphismRestriction. * wagne...@seas.upenn.edu [2012-11-09 14:07:59-0500] > It's possible that the below blog post is related. > ~d > > http://hackage.haskell.org/trac/ghc/blog/LetGeneral

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-09 Thread wagnerdm
It's possible that the below blog post is related. ~d http://hackage.haskell.org/trac/ghc/blog/LetGeneralisationInGhc7 Quoting Roman Cheplyaka : For this module module Test where import System.Random data RPS = Rock | Paper | Scissors deriving (Show, Enum) instance Random R

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-09 Thread Roman Cheplyaka
Oops, you are right — I had -XNoMonomorphismRestriction in .ghci. I'm not sure whether this fact makes the situation more or less strange :) Roman * Nicolas Frisby [2012-11-09 11:35:58-0600] > My GHC 7.6.1 (on a Mac) compiles this code without any warnings or errors. > > Do you have some other

Re: Unexpected ambiguity in a seemingly valid Haskell 2010 program

2012-11-09 Thread Nicolas Frisby
My GHC 7.6.1 (on a Mac) compiles this code without any warnings or errors. Do you have some other compilation flags in effect? On Fri, Nov 9, 2012 at 11:09 AM, Roman Cheplyaka wrote: > For this module > > module Test where > > import System.Random > > data RPS = Rock | Paper | Scis