terça-feira, 31 de janeiro de 2012

Haskell Types

Types exists to classify identities (according to their characteristics).
In Haskell every expression have a associated type
e :: T
means that the type of expression e is T.

58 :: Int
'a' :: Char
[1, 2, 3] :: [Int]
('a', 3) :: (Char, Int)

  • Basic Types
Bool Boolean True, False
Char Characters 'a', 'B', '1', '\n', ...
Int Integers with limited size 1, -8, 234345, ...
Integer Integers with unlimited size 1, -8, 54634785464345345, ...
Float Numbers with float coma 3.5, 4.0, -6.4356, 51.2e7, 3e4, ...
Double Numbers with float with double precision 3.5, -6.342342345543, 51.2e7, ...

Sem comentários:

Enviar um comentário