[GHC] #9813: Error when reifying type constructor

GHC ghc-devs at haskell.org
Fri Feb 12 18:28:16 UTC 2016


#9813: Error when reifying type constructor
-------------------------------------+-------------------------------------
        Reporter:  owst              |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  7.8.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1899
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by owst):

 Replying to [comment:17 rwbarton]:
 > Right. We at least can't allow an expression splice to refer to the type
 of the containing declaration:
 > {{{
 > x = $(if the type of x is Char then [| False |] else [| 'a' |])
 > }}}

 Nice example!

 >     2-3. Within each region, process all the declarations that do not
 contain splices first. Then process all the declarations that do contain
 splices, making the declarations in the former group available for
 reification and calling.

 Hmm, I think the topological sorting ''is'' required within regions, what
 about:

 {{{#!hs
 module Foo where

 f = $(...)
 g = $(reify 'f ...)
 h = 1
 }}}

 I think we want to, in order:
 1. Process {{{h}}}
 2. Process {{{f}}}, which can refer to {{{h}}} but not {{{f}}} or {{{g}}}
 3. Process {{{g}}}, which can ref to {{{h}}} and {{{f}}}, but ''not''
 {{{g}}}.

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


More information about the ghc-tickets mailing list