@@ -74,22 +74,107 @@ String literals are enclosed in double-quotes and may extend over multiple lines
77−The two boolean literals are `true` and `false`.
77+The two boolean literals are ``true`` and ``false``.
79Array literals are surrounded by square brackets, as in Javascript::
82Array literals are surrounded by square brackets, as in Javascript::
84−Object literals are surrounded by braces, as in Javascript::
90+Record literals are surrounded by braces, as in Javascript::
87 { foo: "Foo", bar: 1 }
93 { foo: "Foo", bar: 1 }
98+To retrieve the element of an array at an index, use the ``!!`` operator::
102+This example corresponds to the Javascript ``arr[0]``.
107+To access a property of a record, use a dot, followed by the property name, as in Javascript::
114+Functions are introduced by using a backslash followed by a list of argument names::
116+ example1 = \a b -> a + b
118+which would correspond to the following Javascript::
120+ function example1(a) {
121+ return function (b) {
126+Multiple argument functions can be introduced by wrapping the arguments in parentheses, and separating them with commas::
128+ example2 = \(a, b) -> a + b
132+ function example2(a, b) {
136+There is a special case for functions with no arguments, where the parentheses may be omitted, as follows::
140+which would correspond to the Javascript::
142+ function example3() {
146+Multiple-argument and single-argument syntax can be mixed, as follows::
148+ example4 = \a (b, c) d -> a + b + c + d
152+ function example4(a) {
153+ return function (b, c) {
154+ return function (d) {
155+ return a + b + c + d;
160+Functions are applied by providing their arguments inside parentheses::
165+A special case is made in the case of functions with one argument. These functions can be applied without parentheses, and function application associates to the left::
167+ addThree :: Number -> Number -> Number -> Number
168+ addThree a b c = a + b + c
170+ addThree 1 :: Number -> Number -> Number
171+ addThree 1 2 :: Number -> Number
172+ addThree 1 2 3 :: Number
89If-Then-Else Expressions
174If-Then-Else Expressions
90------------------------
175------------------------
92−The `if`, `then` and `else` keywords can be used to create conditional expressions. In this case, the `else` block is always required.
177+The ``if``, ``then`` and ``else`` keywords can be used to create conditional expressions. In this case, the ``else`` block is always required.
94For example::
179For example::