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
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
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
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
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
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
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