I just feel I should say that Hazy’s import system is one of the things I’m quite proud of. Not only do I fully support local imports without the top level import requirement, but I also have proper recursive modules without hs-boot files and I even have lazy importing. If you have an import without wildcards where you don’t use the imports, the module never even gets opened.
Here is some code actual code from my tests:
module Sloppy where
import Nonexistent (unused)
value, value2 :: ()
value = ()
value2 = value
A big reason why I’m able to do this is by not supporting orphan instances whatsoever. If orphan instances don’t exist, then by definition if a class and type are in scope, then all it’s instances are too. The problem of scoped instances just goes away. Orphan instances really shouldn’t be allowed.