Simple Types
Simple Types
Hamler is strongly typed, and has a powerful static type system. Let’s start with some simple examples.
Boolean
true :: Boolean
false :: Boolean
Numbers
Hamler has Integer and Float, and since they have different types so they can’t be mixed.
--Integer
1 :: Integer
--Float
0.1 :: Float
Atoms
Atom is probably more familiar to Erlang user. It is a literal, a constant with a name starting with : .
:hello
:world
Strings
In Hamler String is just a list of Char
"Hello World" :: String -- ['H','e','l','l','o',',','W','o','r','l','d']
Binaries
This is the very unique datatype exists in Erlang, and notes for Haskell users Binary contains the same information as ByteString if you are not very familiar with binaries, this link should be helpful for some intuition.
<<1,2,3:8,4:16,5,"abcdefg">> :: Binary
