As of 0.13.6 of the language this is a valid module:
module A (myInt) where -- Notice that this type is _not_ exported type PrivateInt = Int myInt :: PrivateInt myInt = 1
When generating documentation this causes
purs docs to generate a broken link for the
PrivateInt type in
myInt's signature. Haskell has a similar situation, where you end up with Haddocks with “unclickable” types.
Disallowing this would obviously be a breaking change, but I’m curious if people are using this pattern in the wild and with what motivation. To me it seems that exporting a value/function with a signature involving a type synonym means that synonym is also relevant for the caller and thus should be exported.
Kind of a similar situation with synonyms in exported types:
module A (MyType) where -- Notice that this type is _not_ exported type Private = Int type MyType = Private
already fails with
Error 1 of 1 An export for MyType requires the following to also be exported: Private
Compiler Issue: https://github.com/purescript/purescript/issues/3879