diff options
author | Chris Martin <ch.martin@gmail.com> | 2018-08-30 13:23:59 -0400 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-09-18 07:51:36 +0300 |
commit | 4edc6d64d1bc1898c0974cf26c5713a3b2724a0b (patch) | |
tree | 5ffca196dac767deb470828cd440e7996aa2957d /docs | |
parent | 5840734379da5d494a368d0b8a6edf1b1216a7f4 (diff) | |
download | haskell-4edc6d64d1bc1898c0974cf26c5713a3b2724a0b.tar.gz |
Users guide: EmptyDataDecls on by default
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 6d960a61d3..3ce6a6029e 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2314,8 +2314,16 @@ Data types with no constructors Allow definition of empty ``data`` types. -With the :extension:`EmptyDataDecls` extension, GHC -lets you declare a data type with no constructors. For example: :: +With the :extension:`EmptyDataDecls` extension, GHC lets you declare a +data type with no constructors. + +You only need to enable this extension if the language you're using +is Haskell 98, in which a data type must have at least one constructor. +Haskell 2010 relaxed this rule to allow data types with no constructors, +and thus :extension:`EmptyDataDecls` is enabled by default when the +language is Haskell 2010. + +For example: :: data S -- S :: Type data T a -- T :: Type -> Type |