[GHC] #1409: Allow recursively dependent modules transparently (without .hs-boot or anything)
GHC
cvs-ghc at haskell.org
Sat Aug 18 17:04:08 CEST 2012
#1409: Allow recursively dependent modules transparently (without .hs-boot or
anything)
---------------------------------+------------------------------------------
Reporter: Isaac Dupree | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.10.2
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by singpolyma):
I'm strongly considering using CPP and #include to work around this
problem in my most recent project.
The problem I have is both the duplication of information in two places
(very un-DRY) and having to pick a place to break the import cycle. I
understand that doing this cross-package (if that even ever makes sense at
all) would be very complex, but I think what most people here (correct me
if I'm wrong) are interested in is the case where all the source for all
the modules is in one project and thus can be build with a single GHC
invocation.
Since pasting the contents of one module into the top of another instead
of importing it works (hence my thoughts about CPP and #include) the way
forward seems to be: treat all modules in a cycle as a single module with
multiple names/export lists. That way the compiler has no problem (since
it can compile all these as one module already, if I paste all the code
together) and imports of any of the modules into *other* modules would
still work (since GHC would just pick which things to import/can be
imported from the mega-module based on which of its names was used).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1409#comment:53>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list