[GHC] #9980: TcS monad is too heavy

GHC ghc-devs at haskell.org
Tue May 22 17:23:40 UTC 2018


#9980: TcS monad is too heavy
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.4
      Resolution:                    |             Keywords:
                                     |  TypeCheckerPlugins
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 diatchki):

 I hand't seen this ticket until Adam updated it a couple of days ago.  Is
 that still the plan?   The main things I can think of that a plugin might
 want from `TcM` are:

    1. access to variable "sort" (e.g., `isTouchableMetaVar`)
    2. a way to lookup things in the environment so that a plugin can
 recognize the types it supposed to work with (e.g., a plugin might know
 that it wants to work on type `T` defined in module `X.Y.Z`, but it needs
 to lookup this type's `TyCon` so that it can recognize the type in a
 constraint).

 On the second point:  it is probably better if a plugin looks up this
 information only once (on startup) and stores the info somewhere, rather
 than looking it up all the time.  So we could probably change the plugin
 API to add some initialization in `TcM`, but then keep the actual plugin
 execution in `TcS`.

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


More information about the ghc-tickets mailing list