import Html exposing (text) main = text "Hello World"
x = 4 x: Int = 4
-- Basic types x: number x: Int x: Float x: String x: Char x: Bool -- List myList: List = [1, 2, 3] -- Tuple myTuple: Tuple = (1, 2, 3) -- Maybe x: Maybe -- Result x: Result
-- Arithmetic operators % -- modulo (remainder) // -- floor division -- Logical operators == -- equal != -- not equal && -- AND || -- OR xor -- XOR not -- NOT
if a > b then -- statement else -- statement
add x y = x+y -- Call function add 5 10
-- Maybe type userName: Maybe String userName = Just "Peter" userName = Nothing -- Result type userId: Result String Int userId = Ok 10 userId = Err "Not a valid id"