开发者

Hiding constructors of data type

开发者 https://www.devze.com 2023-01-10 15:50 出处:网络
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 expor开发者

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 expor开发者_如何转开发ted?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消