
#9699: TH function to list names in scope -------------------------------------+------------------------------------- Reporter: | Owner: MikeIzbicki | Status: new Type: feature | Milestone: request | Version: 7.8.3 Priority: normal | Keywords: Component: Template | Architecture: Unknown/Multiple Haskell | Difficulty: Unknown Resolution: | Blocked By: Operating System: | Related Tickets: Unknown/Multiple | Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): Indeed it would not be hard. I'd be open to patches. There are open design questions. Do you mean "all names in scope" (including imported ones)? There may be a lot of those. Or just those bound in this module? Or just those bound by nested (non-top-level) definitions? Moreover, although, say `Data.List.partition` may not be ''lexically'' in scope, it's fine to generate a TH program that refers to it, thus: {{{ module Foo where import Bar( bar ) f x = $(bar 5) }}} where `bar` is a TH function in another module `Bar` where `Data.List.partition` is in scope, and `(bar 5)` expands to code mentioning `partition`. So, is `Data.List.partition` "in scope"? As ever, getting the specification right (and precise) is a big part of the work! Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9699#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler