Type synonym

From HaskellWiki
Revision as of 20:15, 26 November 2007 by Lemming (talk | contribs) (initial version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 type synonym is a different name for a type. Values of different synonyms of the same type are entirely compatible. In Haskell you can define a type synonym using type:

type MyChar = Char

In C you define a type synonym using typedef.