tags:

views:

109

answers:

1

When importing some data type, it is necessary to put (..) for constructors to be imported.

Is it possible to prevent exporting constructors of some data type, even when that data type is exported?

+5  A: 

Yes, just use the same syntax when exporting them - Foo() just to export the type, Foo(..) to export the type and all constructors, and Foo(FooC1,FooC2) to just export the named constructors of the type.

Ganesh Sittampalam
Just "Foo" in the export list is enough to omit the constructors.
Anthony
@Anthony: A fact that I rediscover on a regular basis, by first forgetting it, then wondering why my constructors aren't in scope...
camccann
FWIW I prefer being explicit that I'm exporting no constructors.
Ganesh Sittampalam