Personal tools

Type signature

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(short explanation)
(more links)

Latest revision as of 00:16, 30 December 2010

A type signature is a line like

inc :: Num a => a -> a

that tells, what is the type of a variable.

In the example
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.

[edit] References