[GHC] #10599: Template Haskell doesn't allow `newName "type"`

GHC ghc-devs at haskell.org
Mon Nov 9 18:37:52 UTC 2015


#10599: Template Haskell doesn't allow `newName "type"`
-------------------------------------+-------------------------------------
        Reporter:  meteficha         |                Owner:  goldfire
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.0.1
       Component:  Template Haskell  |              Version:  7.10.2-rc2
      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 goldfire):

 Replying to [comment:14 simonpj]:
 > But how could they be exported anyway?  You can't mention it in the
 export list, presumably.

 But you can. :(

 {{{
 {-# LANGUAGE TemplateHaskell #-}

 module TestTH ( bar ) where

 import Language.Haskell.TH

 $( do bar <- newName "bar"
       return [ValD (VarP bar) (NormalB (ConE 'True)) []] )
 }}}

 They also get exported with an omitted export list.

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


More information about the ghc-tickets mailing list