In keeping with the KISS principle, I’m currently contemplating {-# INTERNAL #-}
being used at the module level. It (sort of) takes its inspiration from the {-# BOOT #-}
pragma used in dealing with cyclic module imports:
-
modules deemed “low-level” or “internal” would attract a
{-# INTERNAL #-}
on their module declaration:module {-# INTERNAL #-} UglyBits (...) where
-
to import one without warnings requires
{-# INTERNAL #-}
in theimport
declaration:import {-# INTERNAL #-} UglyBits (...)
Then the PVP could be applied to packages/libraries intended for “internal use”, and novices would be warned if they use them. Note: there should not be a way to cancel {-# INTERNAL #-}
warnings as that would defeat the purpose of using {-# INTERNAL #-}
to being with! (as novices would eventually find out how to disable those “inconvenient” warnings…)
As for an extra cabal
stanza…that would definitely save a lot of keystrokes! However, it would depend on whether the same keyphrase (e.g. internal-package
) can be used at both places - where the package is declared, and where the package is used.