[GHC] #11035: Add implicit call-stacks to partial functions in base

GHC ghc-devs at haskell.org
Sun Nov 1 04:02:25 UTC 2015


#11035: Add implicit call-stacks to partial functions in base
-------------------------------------+-------------------------------------
        Reporter:  gridaphobe        |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      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 goldfire):

 Replying to [comment:5 nomeata]:
 > How about we stay on top of the slipperly slope for a while, and let
 people experiment with their call-stack enabled custom Preludes first for
 a while?

 Perhaps that's true. But this change would be quite under-the-hood, so I'm
 less worried about changing libraries in this way.

 >
 > In fact, what I do not like about
 > {{{
 > ghci> minimumBy compare []
 > *** Exception: Prelude.foldr1: empty list
 > CallStack:
 >   error, called at libraries/base/GHC/List.hs:999:3 in
 base-4.8.2.0:GHC.List
 > }}}
 > is that it leaks implementation details. This is great in your own code,
 but a polished library should _not_ leak a call stack about its details;
 it should either print plain exception or the call stack that finishes at
 the library’s API. At least for “expected exceptions” like `"empty list"`.

 I disagree with this push toward perfection. I understand what you're
 getting at here, and I agree in principle. But I think this issue (which
 does seem to be independent from the original ticket) is not terribly
 important to solve. In other languages, I've seen standard libraries spill
 their implementation details all over the place in stack traces.

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


More information about the ghc-tickets mailing list