
18 Sep
2020
18 Sep
'20
3:22 a.m.
Thank you Henning. This is true. When one wishes to provide an abstract type, surely one would like to re-export the type constructor, but not the associated data constructors — so explicit exports become unavoidable. I have not accounted for this detail.
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.