[Haskell-cafe] Are explicit exports and local imports desirable in a production application?

Henning Thielemann lemming at henning-thielemann.de
Wed Sep 16 21:01:31 UTC 2020


On Wed, 16 Sep 2020, Ignat Insarov wrote:

>> You need explicit exports in the public interface, in my example module
>> "A".
>
> How so?

My example should be like so:

module A.Internal where

data T = Private Integer


module A (
    T,  -- do not export constructor
    f,
    ) where

import A.Internal (T(Private))

f :: FooBar
f = do something with Private


You would need the export list in A for exposing T, but not Private.


More information about the Haskell-Cafe mailing list