diff options
author | woclass <inkydragon@users.noreply.github.com> | 2018-12-03 20:30:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 20:30:45 +0800 |
commit | cd7816a2be62b0dcd2aca181d1aadd68b8e4d5d7 (patch) | |
tree | f75c300c92d40e29bf59f83775aec019b45e56e7 /fsharp.html.markdown | |
parent | 440247a59706603bd980016821ecd6a72a6182d1 (diff) | |
parent | 1fd955ae6479650b987a54a93b09507bfdf06954 (diff) |
Merge pull request #1 from adambard/master
Update from Upstream
Diffstat (limited to 'fsharp.html.markdown')
-rw-r--r-- | fsharp.html.markdown | 5 |
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 |