[GHC] #12015: Add conditional CallStack constraints to common partial utility functions

GHC ghc-devs at haskell.org
Thu May 5 17:13:33 UTC 2016


#12015: Add conditional CallStack constraints to common partial utility functions
-------------------------------------+-------------------------------------
           Reporter:  bgamari        |             Owner:
               Type:  task           |            Status:  new
           Priority:  normal         |         Milestone:  8.2.1
          Component:  Compiler       |           Version:  8.0.1
           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:
-------------------------------------+-------------------------------------
 There are a variety of common utility functions used throughout GHC which
 are partial (e.g. many of the helpers in `Type`, for instance,
 `kindPrimRep`). It would be great if [ImplicitCallStacks] would identify
 their callers. However, we likely don't want to pay the cost of passing
 around `CallStacks` during normal compilation so I propose we make them
 conditional on `DEBUG`. That is, define
 {{{#!hs
 #if DEBUG
 type DebugCallStack = CallStack
 #else
 type DebugCallStack = (() :: Constraint)
 #endif
 }}}

 Now we can sprinkle `DebugCallStack` constraints about GHC and get the
 best of both worlds!

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


More information about the ghc-tickets mailing list