[GHC] #10857: "ghci -XMonomorphismRestriction" doesn't turn on the monomorphism restriction

GHC ghc-devs at haskell.org
Mon Sep 21 16:16:28 UTC 2015


#10857: "ghci -XMonomorphismRestriction" doesn't turn on the monomorphism
restriction
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                   Owner:  cocreature
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  GHCi              |                 Version:  7.10.1
      Resolution:                    |                Keywords:  newcomer
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #3202, #3217      |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by thomie):

 Which tests fail if you add `-XNoMonomorphismRestriction` to the standard
 DynFlags?

 You linked to `-fimplicit-import-qualified` being added to the standard
 DynFlags. I see there is a TODO (XXX) there, so it looks like this is
 considered to be a bug. But I'm having trouble coming with an example that
 would trigger the bug, can you? I tried the following, expecting it to be
 erroneously accepted by GHCi (when running `ghci Test.hs`), but it isn't:

 Test.hs:
 {{{
 main = print $ Data.List.foldl' (+) 0 [1,2,3]
 }}}
 This fails with `error: Not in scope: ‘Data.List.foldl'’`. So now I don't
 understand the difference between the standard DynFlags and the
 interactive DynFlags.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10857#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list