mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
[fsharp/en] Add note on equality operator
Add a note pointing out the use of single char "=" equality operator.
This commit is contained in:
parent
b1e24fffcb
commit
681bf26320
@ -53,7 +53,8 @@ add 2 3 // Now run the function.
|
|||||||
|
|
||||||
// to define a multiline function, just use indents. No semicolons needed.
|
// to define a multiline function, just use indents. No semicolons needed.
|
||||||
let evens list =
|
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
|
List.filter isEven list // List.filter is a library function
|
||||||
// with two parameters: a boolean function
|
// with two parameters: a boolean function
|
||||||
// and a list to work on
|
// and a list to work on
|
||||||
|
Loading…
Reference in New Issue
Block a user