I will ask about utility. This concerns the effect on the size of the compiled executable / library. Not about code support or readability.
Import a specific module
Is it useful to import only the used module from the package instead of importing the main module (which itself imports the submodules).
For example, with a module Foreign
(which contains only the import list):
import Foreign.Storable
instead:
import Foreign
Importing functions / types explicitly
Is it useful to import only used functions / types instead of importing the whole module?
For instance:
import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr, withForeignPtr)
instead:
import Foreign.ForeignPtr
source
share