[GHC] #9049: Expose srcLoc from the assertion architecture to allow better error messages

GHC ghc-devs at haskell.org
Wed Dec 17 06:41:50 UTC 2014


#9049: Expose srcLoc from the assertion architecture to allow better error
messages
-------------------------------------+-------------------------------------
              Reporter:  nh2         |            Owner:  gridaphobe
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 One use-case that the implicit parameters approach supports that neither
 -prof nor -g really do is reifying the source locations to a data
 structure that your haskell program can process. I imagine this is a
 fairly niche scenario, but it's extremely useful for embedded DSLs. I was
 recently working on tooling support for an EDSL used to write large (10+
 kloc) programs, and providing useful diagnostic messages for the DSL was
 quite difficult, because I only had access to the internal AST, nothing
 remained of the original haskell program. I ended up writing a Core-to-
 Core plugin to insert the source locations that I mined from -prof, but
 it's a bit kludgy. This approach, on the other hand, makes it trivial for
 a function to get a hold of its call-site.

 Perhaps it would make sense to discuss the implications of this feature
 for library authors on the core-libraries list?

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


More information about the ghc-tickets mailing list