[GHC] #13360: Add a flag to enable inferring HasCallStack constraints

GHC ghc-devs at haskell.org
Wed Nov 1 14:51:40 UTC 2017


#13360: Add a flag to enable inferring HasCallStack constraints
-------------------------------------+-------------------------------------
        Reporter:  gridaphobe        |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  8.4.1
       Component:  Compiler          |              Version:  8.0.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 gridaphobe):

 The underlying data structure is a slight twist on a linked list.

 https://hackage.haskell.org/package/base-4.10.0.0/docs/src/GHC.Stack.Types.html#CallStack

 The `FreezeCallStack` constructor is an experimental addition to let
 library authors avoid exposing implementation details in `CallStack`s.

 You're right that the cost of adding a `CallStack` should be roughly
 equivalent to passing another argument around, plus the cost of allocating
 each source location in the stack. It would make sense for the cost to be
 linear in the depth of the stack, each addition needs to allocate a new
 `PushCallStack` constructor, but maybe the constant factors can be
 improved.

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


More information about the ghc-tickets mailing list