Type signature

From HaskellWiki
Revision as of 00:11, 30 December 2010 by Lemming (talk | contribs) (short explanation)
(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 signature is a line like

inc :: Num a => a -> a

that tells, what is the type of a variable. In the example inc is the variable and Num a => a -> a is its type, namely a function type.

It is considered good style to add a type signature to every top-level variable.

References