Ticket #1480 (new feature request)

Opened 6 years ago

Last modified 8 weeks ago

Template Haskell should allow reification of modules

Reported by: igloo Owned by:
Priority: normal Milestone: _|_
Component: Template Haskell Version: 6.6.1
Keywords: Cc: Bulat.Ziganshin@…, ezyang@…, v.dijk.bas@…, hackage.haskell.org@…, ddf1991@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It should be possible to reify a module from a splice. If the module is thisModule then it would only tell you about things above the current splice.

This comes up quite often; for example:

In  http://www.haskell.org/pipermail/haskell-cafe/2007-June/027205.html Brent Yorgey wants to get a list of top-level functions names prop_* in order to build a runQuickCheckProps function.

In  http://www.haskell.org/pipermail/haskell-cafe/2007-June/026493.html Neil Mitchell wants to get all the data/newtype declarations in a module in order to declare Typeable and Data instances for them.

Change History

Changed 6 years ago by guest

  • cc Bulat.Ziganshin@… added

Changed 6 years ago by igloo

#1444 is also somewhat related.

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to _|_

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 17 months ago by ezyang

  • cc ezyang@… added
  • failure set to None/Unknown

Another use-case: creating libraries like lifted-base programmatically.

Changed 17 months ago by basvandijk

  • cc v.dijk.bas@… added

Changed 8 weeks ago by liyang

  • cc hackage.haskell.org@… added

+1 what ezyang said.

Changed 8 weeks ago by ddfisher

  • cc ddf1991@… added

I'm working on writing a low-boilerplate FFI from Python to Haskell and would find this very useful as well.

Note: See TracTickets for help on using tickets.