[GHC] #14963: ghci -fdefer-type-errors can't run IO action from another module

GHC ghc-devs at haskell.org
Wed Jun 6 20:47:00 UTC 2018


#14963: ghci -fdefer-type-errors can't run IO action from another module
-------------------------------------+-------------------------------------
        Reporter:  elaforge          |                Owner:  tdammers
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.4.2
       Component:  GHCi              |              Version:  8.4.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by tdammers):

 However the dumped Core for the interactive expression itself seems to
 depend only on whether type error deferring was active while loading the
 module.

 Evaluating `test` interactively without `-fdefer-type-errors`:
 {{{
 ==================== Simplified expression ====================
 GHC.Base.returnIO
   @ [()]
   (GHC.Types.:
      @ ()
      ((GHC.Base..
          @ (GHC.Types.IO GHC.Base.String)
          @ (GHC.Types.IO GHC.Base.String)
          @ [GHC.Types.Char]
          (GHC.GHCi.ghciStepIO
             @ GHC.Types.IO GHC.GHCi.$fGHCiSandboxIOIO @ GHC.Base.String)
          (\ (s_a1z7 :: [GHC.Types.Char]) ->
             GHC.Base.$
               @ 'GHC.Types.LiftedRep
               @ [GHC.Types.Char]
               @ (GHC.Types.IO GHC.Base.String)
               (GHC.Base.return
                  @ GHC.Types.IO GHC.Base.$fMonadIO @ [GHC.Types.Char])
               (GHC.Base.++
                  @ GHC.Types.Char
                  (GHC.CString.unpackCString# ":! pointfree \""#)
                  (GHC.Base.++
                     @ GHC.Types.Char s_a1z7 (GHC.CString.unpackCString#
 "\""#)))))
       `cast` (UnsafeCo representational (GHC.Base.String
                                          -> GHC.Types.IO GHC.Base.String)
 ()
               :: (GHC.Base.String -> GHC.Types.IO GHC.Base.String) ~R#
 ()))
      (GHC.Types.[] @ ()))
 }}}

 With `-fdefer-type-errors`:
 {{{
 ==================== Simplified expression ====================
 GHC.Base.bindIO
   @ GHC.Types.Int
   @ [()]
   (GHC.GHCi.ghciStepIO
      @ GHC.Types.IO
      GHC.GHCi.$fGHCiSandboxIOIO
      @ GHC.Types.Int
      Main.test)
   (\ (it_a1CU :: GHC.Types.Int) ->
      GHC.Base.thenIO
        @ ()
        @ [()]
        (System.IO.print @ GHC.Types.Int $dShow_a1Rt it_a1CU)
        (GHC.Base.returnIO
           @ [()]
           (GHC.Types.:
              @ ()
              (it_a1CU
               `cast` (UnsafeCo representational GHC.Types.Int ()
                       :: GHC.Types.Int ~R# ()))
              (GHC.Types.[] @ ()))))
 }}}

 Whether I issue `:set -fno-defer-type-errors` before invoking `test` or
 not makes absolutely no difference.

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


More information about the ghc-tickets mailing list