[GHC] #2339: Template Haskell reification with mkName doesn't work right

GHC trac at galois.com
Wed Jun 4 10:00:19 EDT 2008


#2339: Template Haskell reification with mkName doesn't work right
------------------------------+---------------------------------------------
 Reporter:  simonpj           |          Owner:  simonpj
     Type:  bug               |         Status:  new    
 Priority:  normal            |      Milestone:         
Component:  Template Haskell  |        Version:  6.8.2  
 Severity:  normal            |     Resolution:         
 Keywords:                    |     Difficulty:  Unknown
 Testcase:  TH_reifyMkName    |   Architecture:  Unknown
       Os:  Unknown           |  
------------------------------+---------------------------------------------
Changes (by simonpj):

  * testcase:  => TH_reifyMkName
  * owner:  => simonpj

Comment:

 Yes, there's a bug here, thank you.

 It would certainly be better to say
 {{{
   reify ''C
 }}}
 as someone pointed out.  That is the Right Way.  But what you wrote should
 work too. I'm validating a fix now.

 There's still an ambiguity though. If you write
 {{{
 data T = T Int
 $( ...reify (mkName "T")...)
 }}}
 then are you expecting the ''type constructor'' T or the ''data
 constructor'' T?  My fix gives you the type constructor if there is one,
 and data constructor otherwise.  But you can choose by using the quote
 notation, which is more robust.

 Simon

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


More information about the Glasgow-haskell-bugs mailing list