[GHC] #11573: Inferred CallStacks expose implicit parameter

GHC ghc-devs at haskell.org
Mon Feb 15 09:24:32 UTC 2016


#11573: Inferred CallStacks expose implicit parameter
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  gridaphobe
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1911
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I think that the inferred call stack is also a bug!

 I believe that for top-level bindings that lack a signature, we are not
 inferring a `HasCallStack` constraint:
 {{{
 foo (x:xs) = x
 foo []     = error "foo"
 }}}
 Here we infer `foo :: [a] -> a`, without a `HasCallStack` constraint.
 Correct?

 Alas the [http://downloads.haskell.org/~ghc/master/users-
 guide/glasgow_exts.html#hascallstack user manual section] does not say
 this.  It should.

 Also, I believe that [wiki:ExplicitCallStack/ImplicitLocations this is the
 relevant wiki page] (correct?).  Yet it is full of "proposals", and this
 particular point is an "open choice" under "Discussion".  It would be
 great it

 * The user manual was updated to be a more complete and accurate spec
 * It referred to the wiki page
 * The wiki page was updated to reflect reality

 Finally, back to GHCi. I think that a `let` binding in GHCi should have
 the same status as a top-level binding in a module; and hence should not
 get an automatically-inferred `HasCallStack` constraint.

 So there are four things to fix:
  * Using the `HasCallStack` synonym
  * Treating GHCi `let` bindings as top level
  * Update the user manual
  * Update the wiki page

 Eric, if you are willing it would be great if you could look into this.
 It's such a valuable feature.

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


More information about the ghc-tickets mailing list