Personal tools

Phantom type

From HaskellWiki

Revision as of 19:05, 24 January 2006 by Ashley Y (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.