Skip to content

Instantly share code, notes, and snippets.

@boombang
Last active September 27, 2019 06:56
Show Gist options
  • Save boombang/fb43ae399d277646309a85bea3e9e024 to your computer and use it in GitHub Desktop.
Save boombang/fb43ae399d277646309a85bea3e9e024 to your computer and use it in GitHub Desktop.
add : Int -> Int -> Int
add a b =
a + b
addOne : Int -> (Int -> Int)
addOne a =
add 1
two =
addOne 1
multiply : Int -> Int -> Int
multiply a b =
a * b
divide : Int -> Int -> Int
divide a b =
a // b
q =
Html.text (String.fromInt (add 5 (multiply 10 (divide 30 10))))
-- x |> f = f x
w =
divide 30 10
|> multiply 10
|> add 5
|> String.fromInt
|> Html.text
-- f <| x = f x
e =
Html.text <| String.fromInt <| add 5 <| multiply 10 <| divide 30 10
infixStyle =
2 + 5
prefixStyle =
add 2 5
operatorPrefixStyle =
(+) 2 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment