Commit 4edc6d64 authored by Chris Martin's avatar Chris Martin Committed by Ömer Sinan Ağacan
Browse files

Users guide: EmptyDataDecls on by default

parent 58407343
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment