hidden modules - PureScript

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Mason Mackaman

Is there any way to hide modules in your packages so that they can only be used internally?

Vladimir Ciobanu

No, there is not. This is the same as Haskell: internal modules are just named Internal, e.g. Data.Map.Types.Internal with a warning at the top of the module so people know that the code might change at any time, with no prior changelog warning.

Mason Mackaman

huh, that seems like not the best design

Vladimir Ciobanu

Here's an alternative:

  • create a package like thing-base or thing-core
  • depend on it in thing

You can decide which bits of base/core you re-export from thing, which would make up the public API for that package. If people want to depend on the base/core package, they do it explicitly.

Mason Mackaman

hmm, true, that would be a pain for development though.