I saw much lines like import HSP.ServerPartT()
- list of imports is empty. Why is this done? What difference with just not importing this module?
It imports only typeclass instances from the module. With -Wall
, GHC issues a warning for modules that are imported but from which no definitions are used:
foo.hs:1:1:
Warning: The import of `M' is redundant
except perhaps to import instances from `M'
To import instances alone, use: import M()
The empty import list silences this warning and serves as documentation of the purpose of the import.
That form imports nothing but the instances from that module. And that's the reason of that form, you want to have the instances in scope, but nothing else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With