Opened 4 years ago

Last modified 23 months ago

#8398 new feature request

reify module list in TH

Reported by: errge Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: #1480 Blocking: #7867
Related Tickets: #8337 Differential Rev(s):
Wiki Page:

Description

This patch is for the use-case detailed in #7867.

The added Q monad method provides the ability to get a list of module names in a format that is compatible with the module annotation reification in #8337.

The patch contains a helper method that depends on #8337, so that should be applied first. If this is problematic, it's easy to separate this patch into one that doesn't depend on #8337 and an other that does. Then we can add the latter later.

Attachments (2)

th-8398.patch (3.3 KB) - added by errge 4 years ago.
th part
ghc-8398.patch (1.1 KB) - added by errge 4 years ago.
ghc part

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by errge

Attachment: th-8398.patch added

th part

Changed 4 years ago by errge

Attachment: ghc-8398.patch added

ghc part

comment:1 Changed 4 years ago by errge

Status: newpatch

comment:2 Changed 4 years ago by errge

Blocked By: 8426 added

comment:3 Changed 4 years ago by errge

Component: CompilerTemplate Haskell
Type: bugfeature request
Version: 7.6.37.7

comment:4 Changed 4 years ago by errge

Blocked By: 1480 added; 8426 removed
Milestone: 7.8.17.10.1

This current patch seems to be a bad idea because of the reifyModuleNames API.

It returns a list of modules that are currently "known by the compiler". This "known by the compiler" is very GHC specific, related to orphan modules and hard to text as a standard that is easy to Haskell implementors to follow.

A better API to provide is "a list of modules that this module depends" and "a list of modules that this module depends on transitively".

The first is provided by #1480 and on top of that the second can be implemented as a helper method totally in Language.Haskell.TH.Lib, without introducing new Q monad instructions or changing the compiler in any way.

Therefore I'm setting this blocked by #1480 and targeting 7.10.

comment:5 Changed 4 years ago by errge

Status: patchnew

comment:6 Changed 3 years ago by thomie

This ticket is mentioned on TemplateHaskell/Annotations.

comment:7 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:8 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:9 Changed 23 months ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.