[GHC] #12249: Template Haskell top level scoping error

GHC ghc-devs at haskell.org
Mon Jul 4 13:44:18 UTC 2016


#12249: Template Haskell top level scoping error
-------------------------------------+-------------------------------------
        Reporter:  simonpj           |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.0.1
      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 simonpj):

 > But isn't this what newName is for?

 Well, no.  `newName` is a last resort when quasiquotation won't work.
 Quasiquotes are the preferred way of creating lexically scoped binders.

 And even `newName` will create a new name with distinct unique but the
 same occurrence name, which will give the same "Two top level bindings for
 `x`" error.

 I don't think I'm trying to build a new module/namespace system.  In
 Haskell 2010, it's ok to import two different functions both called `f`
 provided you don't refer to `f` unqualified.  It's the same here.  If I
 mention `x` I expect a complaint about ambiguity; but if I don't I expect
 it to be fine.

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


More information about the ghc-tickets mailing list