summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDivay Prakash <divayprakash@users.noreply.github.com>2018-09-20 23:25:52 +0530
committerGitHub <noreply@github.com>2018-09-20 23:25:52 +0530
commit01140bd131582bd4504ecf444dc3e3c79f428b8c (patch)
tree5ca999825e740d673aec53f50a0a54811a922ad2
parenteb28c0feaf494390fe061a85ae65314cc4519c0e (diff)
parent681bf26320b3540e65d6afa159d3374290c42e69 (diff)
Merge pull request #3222 from lbragaglia/patch-1
[fsharp/en] Add note on equality operator
-rw-r--r--fsharp.html.markdown5
1 files changed, 3 insertions, 2 deletions
diff --git a/fsharp.html.markdown b/fsharp.html.markdown
index dd85552d..59461eed 100644
--- a/fsharp.html.markdown
+++ b/fsharp.html.markdown
@@ -34,7 +34,7 @@ let myFloat = 3.14
let myString = "hello" // note that no types needed
// ------ Lists ------
-let twoToFive = [2; 3; 4; 5] // Square brackets create a list with
+let twoToFive = [2; 3; 4; 5] // Square brackets create a list with
// semicolon delimiters.
let oneToFive = 1 :: twoToFive // :: creates list with new 1st element
// The result is [1; 2; 3; 4; 5]
@@ -53,7 +53,8 @@ add 2 3 // Now run the function.
// to define a multiline function, just use indents. No semicolons needed.
let evens list =
- let isEven x = x % 2 = 0 // Define "isEven" as a sub function
+ let isEven x = x % 2 = 0 // Define "isEven" as a sub function. Note
+ // that equality operator is single char "=".
List.filter isEven list // List.filter is a library function
// with two parameters: a boolean function
// and a list to work on