From: simonpj Date: Mon, 11 Jun 2001 14:15:32 +0000 (+0000) Subject: [project @ 2001-06-11 14:15:32 by simonpj] X-Git-Tag: Approximately_9120_patches~1776 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=14ce3bb45ccf48006fbda5f688c9625d754fcbaf;p=ghc-hetmet.git [project @ 2001-06-11 14:15:32 by simonpj] document data types with no constructors --- 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