[GHC] #11787: Infer HasCallStack where possible

GHC ghc-devs at haskell.org
Mon Apr 4 09:04:23 UTC 2016


#11787: Infer HasCallStack where possible
-------------------------------------+-------------------------------------
           Reporter:  simonpj        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.3
           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:
-------------------------------------+-------------------------------------
 Consider
 {{{
 Prelude> :t error
 error :: GHC.Stack.Types.HasCallStack => [Char] -> a

 Prelude> :t (\x -> error x)
 (\x -> error x)
   :: (?callStack::GHC.Stack.Types.CallStack) => [Char] -> a
 }}}
 We would prefer to get the same type for the latter as the former.

 Moreover, when we execute on #11376 (comment 25), `:t error` will show the
 more complicated type too.

 My suggestion: during generalisation, when we see
 `?callStack::CallStack`, use the built-in type synonym `HasCallStack`.
 Note that this should only happen if the name used for the implicit
 parameter is actually `?callstack`.

 Eric would you like to consider this?

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


More information about the ghc-tickets mailing list