Opened 9 years ago

Last modified 21 months ago

#2522 new feature request

Warning for missing export lists

Reported by: tim Owned by:
Priority: lowest Milestone:
Component: Compiler Version: 6.8.3
Keywords: Cc: NeilMitchell
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect warning at compile-time Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

It occurred to me that it would be nice to have a warning for modules that lack an export list. Obviously not everybody prefers to write export lists for all their modules, but that's why it would be an optional warning. (It would also be handy to use in conjunction with -fwarn-unused-binds.)

If there is already such a flag, then the task is to add it to the users' guide, since I don't see it there :-)

Change History (19)

comment:1 Changed 9 years ago by igloo

difficulty: Unknown
Milestone: 6.12 branch

I guess we wouldn't warn about

module Foo (module Foo) where ...

?

comment:2 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 7 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:5 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:6 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:7 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:8 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:9 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:10 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:11 Changed 5 years ago by morabbin

Type of failure: None/Unknown

Methinks this sort of warning is better suited for the likes of hlint

comment:12 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:13 Changed 3 years ago by thomie

Cc: NeilMitchell added

Neil: is this something hlint could do?

comment:14 Changed 3 years ago by NeilMitchell

Yes, HLint could do that. The Standard Chartered Haskell compiler already warns about missing export lists, and then if you really want to omit the export list you use the module export syntax Ian suggested above. The warning also emits what the export list should be to keep exporting everything, which is a handy feature.

I suspect this fits better as a GHC warning (it seems sufficiently like the other existing warnings), but I'd certainly accept an HLint patch, and then perhaps remove it if it was ever added to GHC. If GHC is likely to punt on this warning for the foreseeable future, please raise an HLint ticket.

comment:15 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:16 Changed 3 years ago by thoughtpolice

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:17 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

comment:18 Changed 21 months ago by thomie

Type of failure: None/UnknownIncorrect warning at compile-time

comment:19 Changed 21 months ago by thomie

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