From 14ce3bb45ccf48006fbda5f688c9625d754fcbaf Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 11 Jun 2001 14:15:32 +0000 Subject: [PATCH] [project @ 2001-06-11 14:15:32 by simonpj] document data types with no constructors --- ghc/docs/users_guide/glasgow_exts.sgml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 390697f..c94c0a2 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -96,6 +96,13 @@ Executive summary of our extensions: + Data types with no constructors + + See . + + + + Parallel list comprehensions An extension to the list comprehension syntax to support @@ -415,6 +422,24 @@ The libraries documentatation gives more details on all these + +Data types with no constructors + +With the + + data S -- S :: * + data T a -- T :: * -> * + +Syntactically, the declaration lacks the "= constrs" part. The +type can be parameterised, but only over ordinary types, of kind *; since +Haskell does not have kind signatures, you cannot parameterise over higher-kinded +types. + +Such data types have only one value, namely bottom. +Nevertheless, they can be useful when defining "phantom types". + + Pattern guards -- 1.7.10.4