[Haskell-cafe] circular imports
Henning Thielemann
schlepptop at henning-thielemann.de
Tue Sep 7 09:39:07 EDT 2010
Simon Peyton-Jones schrieb:
> I was under the impression that the main reason GHC requires .hs-boot
> files is that nobody has had the time or inclination to make it resolve
> circular dependencies automatically, and not an intentional design
> decision to encourage "good design".
>
> Indeed. I’ve added some notes here
> http://hackage.haskell.org/trac/ghc/ticket/1409#comment:37
When reading this, I'm afraid adding this feature will cause more bugs
than features. For me, generally working hs-boot-files would be enough,
that is, hs-boot files that support all situations of mutually depending
classes and instances. I still prefer non-circular modules, because I
understand their relationship more easily. I prefer to explicitly state
when I want cyclic imports, as I currently do with hs-boot files. As
time went by, I become familiar with the discussed methods of avoiding
import cycles and actually, all packages I have written so far do not
contain any circular import and thus no hs-boot file.
More information about the Haskell-Cafe
mailing list