[GHC] #5416: Local modules and Template Haskell declaration splices

GHC cvs-ghc at haskell.org
Tue Aug 16 15:29:39 CEST 2011


#5416: Local modules and Template Haskell declaration splices
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:  _|_         
   Component:  Compiler          |      Version:  7.2.1       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
 Sometimes you want a Template Haskell splice to expand to a bunch of
 declarations, ''some of which are not visible to the context''.  A trivial
 example might be
 {{{
 module M where
  $(f 4)

 ====> expands to
 module M where
  helper = ...blah...
  real_fun = ...helper....
 }}}
 But `helper` is only a helper function for `real_fun` and should not be
 exported by M, nor should it conflict with other definitions in M.

 See #5398 for a more concrete example, and (at the end) a speculative
 suggestion for "local modules" that might be a good design.

 Another thing you might want is for a splice to expand into some import
 declarations that bring some new stuff into scope.  That too might be
 possible using this design.

 Prioity uncertain, details very uncertain.  I'm just making the ticket to
 keep track of the idea.

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



More information about the Glasgow-haskell-bugs mailing list