[GHC] #11549: Add -fshow-runtime-rep

GHC ghc-devs at haskell.org
Fri Jan 6 14:28:54 UTC 2017


#11549: Add -fshow-runtime-rep
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.0.1-rc2
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1961
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 While comment:10 is indeed an odd interaction, these sorts of problems
 become inevitable. I'm reminded of a scene in the movie Interstellar where
 a robot describes that his "honesty setting" is at 90%, because that just
 works out better than being 100% honest. As GHC's type system has become
 more complicated, users have been requesting it to lower its honesty
 setting, hiding bits and pieces that look scary. We now have `-fprint-
 explicit-kinds`, `-fprint-explicit-coercions`, `-fprint-explicit-foralls`,
 `-fprint-equality-relations`, and `-fprint-explicit-runtime-reps`. Each of
 these flags are off by default, and each one is essentially an honesty
 setting. Perhaps with the exception of `-fprint-explicit-coercions`, the
 fact that GHC lies about these aspects of a program means that programmers
 may make mistakes -- it's the old "garbage in, garbage out", but in
 reverse! (with the humans getting and producing the garbage)

 I don't know how to really solve this, short of #8809, which would lead to
 Idris-like interactivity in error messages. We could try to figure out
 when a user has produced garbage in response to a lie that GHC has told
 and then tell the user to tell GHC not to lie (as we do when we suggest
 `-fprint-explicit-kinds` in error messages), but I think we'll always be
 playing catch-up. Instead, we should give the user the direct option (via
 #8809) to know when GHC is lying and to request the truth.

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


More information about the ghc-tickets mailing list