Designing Haskell libraries for qualified import

So colloquially call this Java style Haskell and I follow this very heavy in Hazy. I’m pretty happy with the result, I rarely ever have name conflicts and I think the end result is pretty readable.

Let me talk about my major issue I’ve run into following philosophy and that is .hs-boot hell. Anytime I need types or functions there are mutually recursive, I need to painfully create new .hs-boot modules. Sometimes I even need to reorganize my code because the resulting hs-boot files would be mutually recursive (see There are mutually recursive programs that GHC can't compile). For reference I currently I have 445 normal Haskell files and 95 .hs-boot modules, so 20% of my modules need .hs-boot files (this could probably be reduced).

Still, even with this major problem, I think the end result is much better then alternative.

2 Likes