#1856: Haskell determines that the modules are recursively imported but they are
not, but the problem was the name of a module didn't match the file name
where it was holded
---------------------------------------------------------+------------------
Reporter: guest | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
6.6.2
Component: Compiler | Version: 6.6
Severity: normal | Resolution:
Keywords: Modules Recursively Imported Error Messages | Difficulty:
Unknown
Testcase: | Architecture: x86
Os: Linux |
---------------------------------------------------------+------------------
Changes (by simonpj):
* difficulty: => Unknown
Old description:
> When I am trying to compile the following modules:
>
> File: Files.hs
>
> module Files where
> import SecMonad
>
> File: Lattice.hs
>
> module Lattice where
>
> File: Ref.hs
>
> module Ref where
> import SecMonad
>
> File: Screen.hs
>
> module Screen where
> import SecMonad
>
> File: Sec.hs
>
> module Sec where
> import Lattice
>
> File: SecLib.hs (OBSERVE HERE THAT THE NAME OF THE MODULE IS NOT THE
> SAME AS THE FILE)
> module SecMonad where
> import Lattice
> import Sec
> import SecMonad
> import Files
> import Screen
> import Ref
>
> File: SecMonad.hs
>
> module SecMonad where
>
> import Lattice
> import Sec
>
> I got the message:
> [EMAIL PROTECTED] ~/Sec7 $ ghci SecLib.hs -fglasgow-exts
> GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help
> Loading package base ... linking ... done.
> [1 of 4] Compiling Lattice ( Lattice.hs, interpreted )
> [2 of 4] Compiling Sec ( Sec.hs, interpreted )
> [3 of 4] Compiling SecIO ( SecIO.hs, interpreted )
> Module imports form a cycle for modules:
> main:Resources imports: Files Lattice
> main:Files imports: SecMonad SecIO Lattice
> main:SecMonad
> imports: Resources Ref Screen Files SecMonad SecIO Sec Lattice
> main:Ref imports: SecMonad SecIO Sec Lattice Data.IORef
> main:Screen imports: SecMonad SecIO Lattice
> Failed, modules loaded: SecIO, Lattice, Sec.
> *SecIO>
>
> I think that it would be of great help if the compiler can check if the
> names of the modules match the name of the files. It took me a while to
> discover the stupid mistake, and I believe that, when you have a large
> number of mobules, it might be difficult to find this bug. So, a simple
> check would help a lot in this situation.
>
> That is it!
New description:
When I am trying to compile the following modules:
{{{
File: Files.hs
module Files where
import SecMonad
File: Lattice.hs
module Lattice where
File: Ref.hs
module Ref where
import SecMonad
File: Screen.hs
module Screen where
import SecMonad
File: Sec.hs
module Sec where
import Lattice
File: SecLib.hs (OBSERVE HERE THAT THE NAME OF THE
MODULE IS NOT THE SAME AS THE FILE)
module SecMonad where
import Lattice
import Sec
import SecMonad
import Files
import Screen
import Ref
File: SecMonad.hs
module SecMonad where
import Lattice
import Sec
}}}
I got the message:
{{{
[EMAIL PROTECTED] ~/Sec7 $ ghci SecLib.hs -fglasgow-exts
GHCi, version 6.8.1: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
[1 of 4] Compiling Lattice ( Lattice.hs, interpreted )
[2 of 4] Compiling Sec ( Sec.hs, interpreted )
[3 of 4] Compiling SecIO ( SecIO.hs, interpreted )
Module imports form a cycle for modules:
main:Resources imports: Files Lattice
main:Files imports: SecMonad SecIO Lattice
main:SecMonad
imports: Resources Ref Screen Files SecMonad SecIO Sec Lattice
main:Ref imports: SecMonad SecIO Sec Lattice Data.IORef
main:Screen imports: SecMonad SecIO Lattice
Failed, modules loaded: SecIO, Lattice, Sec.
*SecIO>
}}}
I think that it would be of great help if the compiler can check if the
names of the modules match the name of the files. It took me a while to
discover the stupid mistake, and I believe that, when you have a large
number of mobules, it might be difficult to find this bug. So, a simple
check would help a lot in this situation.
That is it!
Comment:
Wiki formatting in description only.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1856#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs