Elm (programming language): Difference between revisions

Content deleted Content added
m broken a long line into two for readability
Dainiak (talk | contribs)
Line 93:
"Hello World!"
 
-- It is best to add type annotations to top-level declarations.
hello : String
hello =
Line 127:
if number < 0 then negate number else number
 
-- Records are used to hold values with named fields
book : { title : String, author : String, pages : Int }
book =
Line 155:
depth tree =
case tree of
Empty -> 0
Node _ left right ->
1 + max (depth left) (depth right)