... | ... | @@ -24,7 +24,7 @@ Compiler support GHC \[ full -fglasgow-exts \] |
|
|
JHC \[ none \]
|
|
|
LHC \[ full -fglasgow-exts \]
|
|
|
|
|
|
Information from language documentation only. I haven't tried it on any of these systems.
|
|
|
\[Information from language documentation.\]
|
|
|
Summary
|
|
|
Allow data declarations with no constructors.
|
|
|
Description
|
... | ... | @@ -41,8 +41,8 @@ data T a |
|
|
data a :\*: b
|
|
|
|
|
|
data (a :\*\*: b) c
|
|
|
[Kind inference](kind-inference) will of course be carried out for types constructors
|
|
|
introduced by empty declarations just as for any other type constructors according to
|
|
|
[Kind inference](kind-inference) will of course be carried out for type constructors
|
|
|
introduced by empty declarations just as for all other type constructors according to
|
|
|
whatever rules are adopted. Unless there are further constraints, the kinds of the
|
|
|
constructors above would be
|
|
|
S :: \*
|
... | ... | @@ -70,7 +70,6 @@ to syntactically allow a `deriving` clause after an empty data declaration, but |
|
|
contextual error since no interesting instances can be defined. Presumably the reasoning was that this
|
|
|
gives a more regular syntax and better error messages than ruling out deriving for empty declarations
|
|
|
syntactically. But the point is that there is a choice.
|
|
|
A simple and natural generalisation of data declarations, seemingly without any hidden complications.
|
|
|
References[ http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html\#nullary-types](http://www.haskell.org/ghc/docs/latest/html/users_guide/data-type-extensions.html#nullary-types) GHC documentation.
|
|
|
Report Delta
|
|
|
The changes to the report necessary to implement the proposal. Required for a proposal to move to the "accepted" state.
|
... | ... | @@ -95,7 +94,7 @@ This declaration introduces a new type constructor T with one or more constituen |
|
|
with
|
|
|
|
|
|
This declaration introduces a new type constructor T with zero or more constituent data constructors K1, …, Kn.
|
|
|
Download in other formats:[Plain Text](/wiki/EmptyDataDecls?version=7&format=txt)[](http://trac.edgewall.org/)Powered by [Trac 1.2.2](/about)
|
|
|
Download in other formats:[Plain Text](/wiki/EmptyDataDecls?version=8&format=txt)[](http://trac.edgewall.org/)Powered by [Trac 1.2.2](/about)
|
|
|
|
|
|
By [Edgewall Software](http://www.edgewall.org/).Visit the Trac open source project at
|
|
|
[http://trac.edgewall.com/](http://trac.edgewall.com/)
|
... | ... | |