Opened 8 years ago

Last modified 2 years ago

#2551 new feature request

Allow multiple modules per source file

Reported by: YitzGale Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.9
Keywords: Cc: vogt.adam@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


This is helpful because the module system is the only way to achieve encapsulation in Haskell, so the system needs to be as lightweight and flexible as possible. It also makes it easier to share and distribute Haskell programs when it is most convenient to do so as a single file, such as literate Haskell via email.

To use this feature, one would specify files to be compiled explicitly. When GHC searches on its own for modules, it needs the path of the file to indicate the name of the module it contains, so multiple modules are not possible in that case.

See #2550, and the thread in:

Change History (7)

comment:1 Changed 8 years ago by igloo

  • difficulty set to Unknown
  • Milestone set to _|_

I don't think we're likely to implement this any time soon, I'm afraid, unless there is more demand for it.

comment:2 Changed 8 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:3 Changed 8 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple

comment:4 Changed 7 years ago by aavogt

  • Cc vogt.adam@… added
  • Type of failure set to None/Unknown

comment:5 follow-up: Changed 6 years ago by mjg

  • Resolution set to wontfix
  • Status changed from new to closed

Current arrangement seems reasonable "as-is".

Another way to achieve encapsulation is labelled record system (available as Cabal package.)

comment:6 in reply to: ↑ 5 Changed 6 years ago by simonmar

Replying to mjg:

Current arrangement seems reasonable "as-is".

I agree in this instance, but in the future I think it would be better to have some discussion on the mailing list or IRC before closing tickets as "wontfix".

comment:7 Changed 2 years ago by thomie

  • Resolution wontfix deleted
  • Status changed from closed to new
Note: See TracTickets for help on using tickets.