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

GHC ghc-devs at haskell.org
Fri Sep 11 00:38:33 UTC 2015


#10857: "ghci -XMonomorphismRestriction" doesn't turn on the monomorphism
restriction
-------------------------------------+-------------------------------------
        Reporter:  rwbarton          |                   Owner:
            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:
-------------------------------------+-------------------------------------
Changes (by thomie):

 * related:   => #3202, #3217


Comment:

 `ghci -XNoExtendedDefaultRules` does't turn off `ExtendedDefaultRules`
 either:

 {{{
 Prelude> :showi language
 base language is: Haskell2010
 with the following modifiers:
   -XNoDatatypeContexts
   -XExtendedDefaultRules
   -XNoMonomorphismRestriction
   -XNondecreasingIndentation
 }}}


 This seems to be by design. From
 https://ghc.haskell.org/trac/ghc/ticket/3217#comment:15:

  The DynFlags used to compile code will be computed as follows.

  ...

  When compiling an expression typed on the GHCi command line:

  * Start with the baseline DynFlags
  * Apply flags specified on the original command-line
  * (Perhaps: apply flags specified by :set in this GHCi session. We aren't
 sure whether     or not to do this.)
  * Apply GHCi baseline command-prompt flags (e.g. special defaulting
 rules)
  * Apply flags specified by :seti in this GHCi session
  * If there is a fully-open module M, apply flags specified in M itself.
 That is, flags   in M get the last word.

 I agree it is confusing.

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


More information about the ghc-tickets mailing list