[commit: ghc] master: Users guide: EmptyDataDecls on by default (4edc6d6)

git at git.haskell.org git at git.haskell.org
Tue Sep 18 04:51:57 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/4edc6d64d1bc1898c0974cf26c5713a3b2724a0b/ghc

>---------------------------------------------------------------

commit 4edc6d64d1bc1898c0974cf26c5713a3b2724a0b
Author: Chris Martin <ch.martin at gmail.com>
Date:   Thu Aug 30 13:23:59 2018 -0400

    Users guide: EmptyDataDecls on by default


>---------------------------------------------------------------

4edc6d64d1bc1898c0974cf26c5713a3b2724a0b
 docs/users_guide/glasgow_exts.rst | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 6d960a6..3ce6a60 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



More information about the ghc-commits mailing list