
#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): I think it's reasonable to expose the toposort of declarations - users are presumably used to declarations not being processed top-to-bottom already; it seems more consistent to expose toposorted-ness here too, rather than use a different rule. Some thoughts about your proposal (which I like the gist of!): * W.r.t. step 1. I'd quite like the splice in {{{f}}}: {{{#!hs f x = x ++ $(reify 'g ...) $(return []) g x = x + 1 }}} to be able to refer to {{{g}}}. It is in a different declaration group, but I think that it should be visible. However, I can't see an easy way around the need for declaration groups, so maybe it's not possible. * In step 2. I think it would be necessary that a splice within a declaration cannot refer to the declaration itself (though I'm not ''sure'' this is a problem?)
No code that is accepted today would be rejected by these rules. This seems particularly desirable to me!
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9813#comment:16 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler