Open data kinds

Jan Stolarek jan.stolarek at
Sun Jan 3 17:31:21 UTC 2016

> There is no language support to define a 
> "closed datatype" but it is possible to do so by not exporting any of
> the constructors used to make the datatype.
Data types are closed in a sense that if you define

data Foo = MkFoo1

then you cannot add new data constructor, say MkFoo2, that will also create values of type Foo. So 
being open/closed is not about creating new values of a data type but about extending the 
definition with new constructors. Does that answer your question?


Politechnika Łódzka
Lodz University of Technology

Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata.
Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę
prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie.

This email contains information intended solely for the use of the individual to whom it is addressed.
If you are not the intended recipient or if you have received this message in error,
please notify the sender and delete it from your system.

More information about the ghc-devs mailing list