[GHC] #12812: Debugging functions should throw warnings

GHC ghc-devs at haskell.org
Mon Nov 7 03:53:47 UTC 2016


#12812: Debugging functions should throw warnings
-------------------------------------+-------------------------------------
           Reporter:  siddhanathan   |             Owner:
               Type:  task           |            Status:  new
           Priority:  lowest         |         Milestone:
          Component:                 |           Version:  8.0.1
  libraries/base                     |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 The function Debug.Trace.trace is useful for debugging, however, we don't
 want this function to be present in production code. An excerpt from
 Debug.Trace explains why:


 {{{
 The 'trace' function should /only/ be used for debugging, or for
 monitoring
 execution. The function is not referentially transparent: its type
 indicates
 that it is a pure function but it has the side effect of outputting the
 trace message.
 }}}

 It would be useful if the compiler threw warnings when such functions are
 used.

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


More information about the ghc-tickets mailing list