git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update syntax.rst
commitb02f443eb4c8be45b8282cb29cb6160f83d96950 authorPhil Freeman <paf31@cantab.net> dateWed 23 Apr 2014, 22:17 (13 years ago) parent6d15a7d
1 file changed+39−38
docs/source/syntax.rst+39−38
docs/source/syntax.rst+39−38
@@ -19,43 +19,44 @@ But this is not::
1919Operators
2020---------
2121
22−PureScript supports the following unary operators (in precedence order):
23−
24−== =======================
25− Meaning
26−== =======================
27−\- Numeric negation
28−! Boolean negation
29−~ Binary negation
30−\+ Unary plus (numeric)
31−== =======================
32−
33−and the following binary operators (in precedence order):
34−
35−==== =====================
36− Meaning
37−==== =====================
38−\+ Numeric addition
39−\- Numeric subtraction
40−\* Numeric multiplication
41−/ Numeric division
42−% Numeric modulus
43−== Equality check
44−!= Inequality check
45−< Less than
46−<= Less than or equal
47−> Greater than
48−>= Greater than or equal
49−&& Boolean AND
50−|| Boolean OR
51−& Binary AND
52−\| Binary OR
53−^ Binary XOR
54−<< Shift Left
55−>> Shift Right
56−\>>> Zero-Fill Shift Right
57−++ String concatenation
58−==== =====================
22+Binary operators in PureScript are just regular functions. The Prelude defines a number of operators which correspond to Javascript's operators.
23+
24+The Prelude defines the following functions which correspond to Javascript's unary operators::
25+
26+========== ======== =======================
27+Function Operator Meaning
28+========== ======== =======================
29+negate \- Numeric negation
30+not ! Boolean negation
31+complement ~ Binary negation
32+========== ======== =======================
33+
34+and the following binary operators::
35+
36+========== =========== =====================
37+Function JS Operator Meaning
38+========== =========== =====================
39+(\+) \+ Numeric addition
40+(\-) \- Numeric subtraction
41+(\*) \* Numeric multiplication
42+(/) / Numeric division
43+(%) % Numeric modulus
44+(==) == Equality check
45+(/=) != Inequality check
46+(<) < Less than
47+(<=) <= Less than or equal
48+(>) > Greater than
49+(>=) >= Greater than or equal
50+(&&) && Boolean AND
51+(||) || Boolean OR
52+(&) & Binary AND
53+(\|) \| Binary OR
54+(^) ^ Binary XOR
55+shl << Shift Left
56+shr >> Shift Right
57+zshr \>>> Zero-Fill Shift Right
58+(++) + String concatenation
59+========== =========== =====================
5960
6061Literal Values
6162--------------
@@ -185,7 +186,7 @@ A pattern match failure will generate a runtime exception, just as in the case o
185186Operators
186187---------
187188
188−In addition to the standard operators, user-defined infix operators can be created by enclosing names in parentheses.
189+User-defined infix operators can be created by enclosing names in parentheses.
189190
190191E.g. to create a synonym for string concatenation::
191192