If I have a module containing
data Foo = Bar Int | Baz Bool
can I export Bar
and Baz
in their role as "pattern matchers" or "destructors" only and not allow the module user to construct values of type Foo
using them?
That is, I want to permit the usage
f (Bar i) = ... i ...
but prevent the usage
x = Bar i