Phantom type

From HaskellWiki
Revision as of 19:05, 24 January 2006 by Ashley Y (talk | contribs) (+cat)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A phantom type is a type the values of which are never used, the type being used only to construct other types.

An extension to Haskell 98 supported by GHC allows you to define datatypes without any constructors (and therefore no values other than bottom):

data MyType;

This helps distinguish phantom types.