From fa9f4339adbd4d843439c3cbc8ee8e56436ac6b6 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Wed, 20 Jun 2018 08:24:52 -0700 Subject: [PATCH] Live -> master (#313) * Fix broken table (#269) * Fix code indentation (#267) * corrected the output (#276) * Update collections.array - fsharp .md (#271) fixed signature for copy function * fix and consolidate list.xyz2/xyz3 doc for input lists with different lengths (#282) * Fix escape sequence. (#285) * Add missing space (#284) * Fix order of arguments in foldBack lambda (#286) Running the following in F# Interactive will help explain why I believe this change is necessary: > List.foldBack (fun elem acc -> printf "elem: %A " elem; elem + acc) [1;2;3;4] 0;; elem: 4 elem: 3 elem: 2 elem: 1 val it : int = 10 > List.foldBack (fun acc elem -> printf "elem: %A " elem; elem + acc) [1;2;3;4] 0;; elem: 0 elem: 4 elem: 7 elem: 9 val it : int = 10 The accumulator is the second argument in foldBack (contrary to fold where it is the first). Positioning the arguments in reverse in an example is a great way to confuse a reader. This also helps promote the fact that the state and list arguments to the folding function are in the same order as their lambda counterparts. Feel free to disagree :-). * Fix Operators.atan2 description (#287) atan2(y, x) is related to atan(y/x), *not* atan(x/y) * Fixed code formatting (#288) * Corrected prefix minus to prefix plus (#289) * Added missing line break Added missing line break to class definition of Microsoft.FSharp.Reflection.UnionCaseInfo * Removed Missing CustomOperationAttribute Issue #266 * JoinConditionWord was Accidentally removed despite not being duplicated. Fixing this. * Fix typo in Array2D.init docs * Document that Map.pick can throw KeynotFoundException * Update async.startchild['t]-method-[fsharp].md Specify timeout behaviour * Fix List.compareWith case * Update walkthrough-using-visual-fsharp-to-create,-debug,-and-deploy-an-application.md * Added treatment of null-values, and fixed incomplete text on IFormattable (#301) The `string` function casts to `IFormattable` internally. The original text only mentioned integer and floating point values, but in fact, there are many more values in the BCL that implement IFormattable. I improved the text to be more precise. Furthermore, special treatment of `null` was not mentioned, I've added that. Expanded supported platforms, and fixed a typo. * Update quotations.patterns-module-[fsharp].md (#302) Thanks @Columpio * Clarified how ties are resolved (#304) * Add except to list modules (#305) The except function added in https://github.com/fsharp/fslang-design/issues/41 doesn't have a doc here. --- CONTRIBUTING.md | 2 +- .../array.maxby['t,'u]-function-[fsharp].md | 5 +++-- .../conceptual/array2d.init['t]-function-[fsharp].md | 4 ++-- .../async.startchild['t]-method-[fsharp].md | 2 ++ docs/conceptual/collections.array-module-[fsharp].md | 2 +- docs/conceptual/collections.list-module-[fsharp].md | 3 ++- .../core.customoperationattribute-class-[fsharp].md | 7 +------ docs/conceptual/core.operators-module-[fsharp].md | 4 ++-- docs/conceptual/core.printf-module-[fsharp].md | 7 +++---- .../list.exists2['t1,'t2]-function-[fsharp].md | 10 ++++++++-- .../list.fold2['t1,'t2,'state]-function-[fsharp].md | 11 ++++++----- ...st.foldback2['t1,'t2,'state]-function-[fsharp].md | 12 ++++++------ .../list.forall2['t1,'t2]-function-[fsharp].md | 2 +- .../list.iter2['t1,'t2]-function-[fsharp].md | 2 +- .../list.iteri2['t1,'t2]-function-[fsharp].md | 2 +- .../list.map2['t1,'t2,'u]-function-[fsharp].md | 8 +++++++- .../list.map3['t1,'t2,'t3,'u]-function-[fsharp].md | 12 +++++++++--- .../list.mapi2['t1,'t2,'u]-function-[fsharp].md | 8 +++++++- .../list.zip3['t1,'t2,'t3]-function-[fsharp].md | 6 ++++++ .../list.zip['t1,'t2]-function-[fsharp].md | 6 ++++++ .../map.pick['key,'t,'u]-function-[fsharp].md | 8 +++++++- .../operators.atan2[^t1,'t2]-function-[fsharp].md | 2 +- .../operators.string[^t]-function-[fsharp].md | 8 +++++--- .../quotations.patterns-module-[fsharp].md | 4 ++-- .../reflection.fsharptype-class-[fsharp].md | 2 +- .../reflection.unioncaseinfo-class-[fsharp].md | 3 ++- ...elpers.leafexpressionconverter-module-[fsharp].md | 10 +++++----- .../seq.concat['collection,'t]-function-[fsharp].md | 3 ++- docs/conceptual/snippets/fslists/snippet41.fs | 4 ++-- docs/conceptual/strings-[fsharp].md | 6 +++--- ...rp-to-create,-debug,-and-deploy-an-application.md | 4 +--- 31 files changed, 106 insertions(+), 63 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef30952f..ec8d0bc6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -##How to contribute +## How to contribute If you'd like to contribute to the F# documentation, all you need to do is: 1. [Clone the documentation repo](https://help.github.com/articles/cloning-a-repository/) diff --git a/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md b/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md index 2887c28b..79e916d1 100644 --- a/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md +++ b/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md @@ -47,7 +47,8 @@ Returns the maximum element. ## Remarks -This function is named `MaxBy` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. +This function is named `MaxBy` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. +Ties are resolved by returning the element with the lowest ordinal. ## Example @@ -75,4 +76,4 @@ Supported in: 2.0, 4.0, Portable [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) -[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) \ No newline at end of file +[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/array2d.init['t]-function-[fsharp].md b/docs/conceptual/array2d.init['t]-function-[fsharp].md index da87873c..6a96c0ac 100644 --- a/docs/conceptual/array2d.init['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.init['t]-function-[fsharp].md @@ -54,7 +54,7 @@ Returns the generated array. This function is named `Initialize` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. -## Examxample +## Example The following code demonstrates the use of `Array2D.init` to create a two-dimensional array. @@ -74,4 +74,4 @@ Supported in: 2.0, 4.0, Portable [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) -[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) \ No newline at end of file +[Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/async.startchild['t]-method-[fsharp].md b/docs/conceptual/async.startchild['t]-method-[fsharp].md index a5a9ed01..59a9dbeb 100644 --- a/docs/conceptual/async.startchild['t]-method-[fsharp].md +++ b/docs/conceptual/async.startchild['t]-method-[fsharp].md @@ -65,6 +65,8 @@ let! result2 = completor2 When used in this way, each use of `StartChild` starts an instance of `childComputation` and returns a `completor` object representing a computation to wait for the completion of the operation. When executed, the `completor` awaits the completion of `childComputation`. +If child computation doesn't complete in the specified timeout period, the `childComputation` is cancelled and the `completor` raises [`System.TimeoutException`](https://msdn.microsoft.com/en-us/library/system.timeoutexception). + ## Example The following code example illustrates the use of `Async.StartChild`. diff --git a/docs/conceptual/collections.array-module-[fsharp].md b/docs/conceptual/collections.array-module-[fsharp].md index 734661d4..9c4ba778 100644 --- a/docs/conceptual/collections.array-module-[fsharp].md +++ b/docs/conceptual/collections.array-module-[fsharp].md @@ -43,7 +43,7 @@ For an overview of arrays in F#, see [Arrays (F#)](Arrays-%5BFSharp% |[`compareWith`](array.comparewith%5B't%5D-function-%5Bfsharp%5D.md)
**: ('T -> 'T -> int) -> 'T [] -> 'T [] -> int**|Compares two arrays using the given comparison function, element by element.| |[`concat`](https://msdn.microsoft.com/library/f7219b79-1ec8-4a25-96b1-edbedb358302)
**: seq<'T []> -> 'T []**|Creates an array that contains the elements of each of the supplied sequence of arrays.| |[`contains`](array.contains%5B't%5D-function-%5Bfsharp%5D.md)
**: 'T -> 'T [] -> bool**|Evaluates to `true` if the given element is in the input array.| -|[`copy`](https://msdn.microsoft.com/library/9d0202f1-1ea0-475e-9d66-4f8ccc3c5b5f)
**: 'T -> 'T []**|Creates an array that contains the elements of the supplied array.| +|[`copy`](https://msdn.microsoft.com/library/9d0202f1-1ea0-475e-9d66-4f8ccc3c5b5f)
**: 'T [] -> 'T []**|Creates an array that contains the elements of the supplied array.| |[`countBy`](array.countby['t,'key]-function-[fsharp].md)
**: ('T -> 'Key) -> 'T [] -> ('Key * int) []**|Applies a key-generating function to each element of an array and returns am array yielding unique keys and their number of occurrences in the original array.| |[`create`](https://msdn.microsoft.com/library/e848c8d6-1142-4080-9727-8dacc26066be)
**: int -> 'T -> 'T []**|Creates an array whose elements are all initially the supplied value.| |[`distinct`](array.distinct%5B't%5D-function-%5Bfsharp%5D.md)
**: 'T [] -> 'T []**|Returns an array that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the array then the later occurrences are discarded.| diff --git a/docs/conceptual/collections.list-module-[fsharp].md b/docs/conceptual/collections.list-module-[fsharp].md index b18e8f97..133e3803 100644 --- a/docs/conceptual/collections.list-module-[fsharp].md +++ b/docs/conceptual/collections.list-module-[fsharp].md @@ -41,13 +41,14 @@ For an overview of lists in F#, see [Lists (F#)](Lists-%5BFSharp%5D. |[choose](https://msdn.microsoft.com/library/2e21d3fb-ce35-4824-8a57-c4404616093d)
**: ('T -> 'U option) -> 'T list -> 'U list**|Applies the given function to each element of the list. Returns the list comprised of the results for each element where the function returns **Some**.| |[chunkBySize](list.chunkBySize%5B't%5D-function-%5Bfsharp%5D.md)
**: int -> 'T list -> 'T list list**|Divides the input list into chunks of size at most `chunkSize`.| |[collect](https://msdn.microsoft.com/library/cd08bbc7-a3b9-40ab-8c20-4e85ec84664f)
**: ('T -> 'U list) -> 'T list -> 'U list**|For each element of the list, applies the given function. Concatenates all the results and return the combined list.| -|[comparewith](list.comparewith%5B't%5D-function-%5Bfsharp%5D.md)
**: ('T -> 'T -> int) -> 'T list -> 'T list -> int**|Compares two lists using the given comparison function, element by element.| +|[compareWith](list.compareWith%5B't%5D-function-%5Bfsharp%5D.md)
**: ('T -> 'T -> int) -> 'T list -> 'T list -> int**|Compares two lists using the given comparison function, element by element.| |[concat](https://msdn.microsoft.com/library/c5afd433-8764-4ea8-a6a8-937fb4d77c4c)
**: seq<'T list> -> 'T list**|Returns a new list that contains the elements of each the lists in order.| |[contains](list.contains%5B't%5D-function-%5Bfsharp%5D.md)
**: 'T -> 'T list -> bool**|Evaluates to `true` if the given element is in the input list.| |[countBy](list.countby%5B't,'key%5D-function-%5Bfsharp%5D.md)
**: ('T -> 'Key) -> 'T list -> ('Key * int) list**|Applies a key-generating function to each element of a list and returns a list yielding unique keys and their number of occurrences in the original list.| |[distinct](list.distinct%5B't%5D-function-%5Bfsharp%5D.md)
**: 'T -> 'T list**|Returns a list that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the list then the later occurrences are discarded.| |[distinctBy](https://msdn.microsoft.com/library/9293293b-9420-49c8-848f-401a9cd49b75)
**: ('T -> 'Key) -> 'T list -> 'T list**|Returns a list that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the list then the later occurrences are discarded.| |[empty](https://msdn.microsoft.com/library/bb4cb501-3429-47c1-8d5f-71180d3bded7)
**: 'T list**|Returns an empty list of the given type.| +|[except](https://github.com/fsharp/fslang-design/issues/41)
**: seq<'T> -> 'T list -> 'T list**|Returns a list with the distinct elements of the input list which do not appear in the itemsToExclude sequence, using generic hash and equality comparisons to compare values.| |[exactlyOne](https://msdn.microsoft.com/library/bd14fd21-b645-4416-98e4-6a6c49f3a15c)
**: 'T list -> 'T**|Returns the only element of the list.| |[exists](https://msdn.microsoft.com/library/15a3ebd5-98f0-44c0-8220-7dedec3e68a8)
**: ('T -> bool) -> 'T list -> bool**|Tests if any element of the list satisfies the given predicate.| |[exists2](https://msdn.microsoft.com/library/7532b39e-3f4f-4534-a60b-d7721dc6fa7e)
**: ('T1 -> 'T2 -> bool) -> 'T1 list -> 'T2 list -> bool**|Tests if any pair of corresponding elements of the lists satisfies the given predicate.| diff --git a/docs/conceptual/core.customoperationattribute-class-[fsharp].md b/docs/conceptual/core.customoperationattribute-class-[fsharp].md index f3d66c6c..7dc34781 100644 --- a/docs/conceptual/core.customoperationattribute-class-[fsharp].md +++ b/docs/conceptual/core.customoperationattribute-class-[fsharp].md @@ -36,13 +36,8 @@ CustomOperationAttribute member this.IsLikeZip : bool with get, set member this.MaintainsVariableSpace : bool with get, set member this.MaintainsVariableSpaceUsingBind : bool with get, set - member this.Name : string - member this.IsLikeGroupJoin : bool with get, set - member this.IsLikeJoin : bool with get, set - member this.IsLikeZip : bool with get, set member this.JoinConditionWord : string with get, set - member this.MaintainsVariableSpace : bool with get, set - member this.MaintainsVariableSpaceUsingBind : bool with get, set + member this.Name : string end ``` diff --git a/docs/conceptual/core.operators-module-[fsharp].md b/docs/conceptual/core.operators-module-[fsharp].md index b3747fd6..7811b459 100644 --- a/docs/conceptual/core.operators-module-[fsharp].md +++ b/docs/conceptual/core.operators-module-[fsharp].md @@ -76,7 +76,7 @@ For an overview of operators in F#, see [Symbol and Operator Reference (F |[( ||> )](https://msdn.microsoft.com/library/6018719e-de1a-4d1f-8f91-88a35a4f0e8e)
**: 'T1 * 'T2 -> ('T1 -> 'T2 -> 'U) -> 'U**|Apply a function to two values, the values being a pair on the left, the function on the right.| |[( ||| )](https://msdn.microsoft.com/library/69f82f6e-98f3-468c-b5cd-a0b4b411ddb2)
**: ^T -> ^T -> ^T**|Overloaded bitwise OR operator| |[( |||> )](https://msdn.microsoft.com/library/0b5a6221-904a-4cf8-9fd4-ad5a4ec3817b)
**: 'T1 * 'T2 * 'T3 -> ('T1 -> 'T2 -> 'T3 -> 'U) -> 'U**|Apply a function to three values, the values being a triple on the left, the function on the right.| -|[( ~- )](https://msdn.microsoft.com/library/f6c4a5ca-7803-49d2-85fa-0ac3e0c2b3eb)
**: ^T -> ^T**|Overloaded prefix plus operator.| +|[( ~+ )](https://msdn.microsoft.com/library/f6c4a5ca-7803-49d2-85fa-0ac3e0c2b3eb)
**: ^T -> ^T**|Overloaded prefix plus operator.| |[( ~- )](https://msdn.microsoft.com/library/8350b9b2-2f8c-4fd5-8c81-afacc5196d14)
**: ^T -> ^T**|Overloaded unary negation.| |[( ~~~ )](https://msdn.microsoft.com/library/80822c6d-b0a8-445c-adbc-2dd78954cc5d)
**: ^T -> ^T**|Overloaded bitwise NOT operator.| |[abs](https://msdn.microsoft.com/library/9cf0a350-111e-45df-a2d0-306884aeb937)
**: ^T -> ^T**|Absolute value of the given number.| @@ -172,4 +172,4 @@ Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 Supported in: 2.0, 4.0, Portable ## See Also -[Microsoft.FSharp.Core Namespace (F#)](Microsoft.FSharp.Core-Namespace-%5BFSharp%5D.md) \ No newline at end of file +[Microsoft.FSharp.Core Namespace (F#)](Microsoft.FSharp.Core-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/core.printf-module-[fsharp].md b/docs/conceptual/core.printf-module-[fsharp].md index b9c7aec8..49654d4e 100644 --- a/docs/conceptual/core.printf-module-[fsharp].md +++ b/docs/conceptual/core.printf-module-[fsharp].md @@ -53,9 +53,8 @@ The optional *width* is an integer indicating the minimal width of the result. F Valid flags are described in the following table. - -|| -|-| +|Flag|Description| +|----|-----------| |`0`|Specifies to add zeros instead of spaces to make up the required width.| |`-`|Specifies to left-justify the result within the width specified.| |`+`|Specifies to add a `+` character if the number is positive (to match a `-` sign for negative numbers).| @@ -104,4 +103,4 @@ Supported in: 2.0, 4.0, Portable Supported in: 2, 3 ## See Also -[Microsoft.FSharp.Core Namespace (F#)](Microsoft.FSharp.Core-Namespace-%5BFSharp%5D.md) \ No newline at end of file +[Microsoft.FSharp.Core Namespace (F#)](Microsoft.FSharp.Core-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/list.exists2['t1,'t2]-function-[fsharp].md b/docs/conceptual/list.exists2['t1,'t2]-function-[fsharp].md index 85b797d7..a65af04c 100644 --- a/docs/conceptual/list.exists2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/list.exists2['t1,'t2]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 09474659-eff2-4903-bdbd-967f65f00f17 # List.exists2<'T1,'T2> Function (F#) -Tests if any pair of corresponding elements of the lists satisfies the given predicate. +Tests if any pair of corresponding elements of the lists satisfies the given predicate. The lists must have equal lengths. **Namespace/Module Path:** Microsoft.FSharp.Collections.List @@ -55,8 +55,14 @@ The second input list. `true` if any pair of elements satisfy the predicate. Otherwise, returns `false`. +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks -The predicate is applied to matching elements in the two collections up to the lesser of the two lengths of the collections. If any application returns true then the overall result is true and no further elements are tested. +The predicate is applied to matching elements in the two collections. If any application returns true then the overall result is true and no further elements are tested. This function is named `Exists2` in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.fold2['t1,'t2,'state]-function-[fsharp].md b/docs/conceptual/list.fold2['t1,'t2,'state]-function-[fsharp].md index ab63a150..9b66f5df 100644 --- a/docs/conceptual/list.fold2['t1,'t2,'state]-function-[fsharp].md +++ b/docs/conceptual/list.fold2['t1,'t2,'state]-function-[fsharp].md @@ -13,7 +13,8 @@ ms.assetid: 3c8edaf5-fbbb-4726-900e-b2423c54caf0 # List.fold2<'T1,'T2,'State> Function (F#) -Applies a function to corresponding elements of two collections, threading an accumulator argument through the computation. The collections must have identical sizes. If the input function is `f` and the elements are `i0...iN` and `j0...jN` then computes `f (... (f s i0 j0)...) iN jN`. +Applies a function to corresponding elements of two lists, threading an accumulator argument through the computation. The lists must have equal lengths. +If the input function is `f` and the elements are `i0...iN` and `j0...jN` then computes `f (... (f s i0 j0)...) iN jN`. **Namespace/Module Path:** Microsoft.FSharp.Collections.List @@ -58,16 +59,16 @@ Type: **'T2**[list](https://msdn.microsoft.com/library/c627b668-477b-4409-91ed-0 The second input list. +## Return Value + +The final state value. + ## Exceptions |Exception|Condition| |----|----| |[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| -## Return Value - -The final state value. - ## Remarks This function is named `Fold2` in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.foldback2['t1,'t2,'state]-function-[fsharp].md b/docs/conceptual/list.foldback2['t1,'t2,'state]-function-[fsharp].md index 05208467..570a861f 100644 --- a/docs/conceptual/list.foldback2['t1,'t2,'state]-function-[fsharp].md +++ b/docs/conceptual/list.foldback2['t1,'t2,'state]-function-[fsharp].md @@ -13,7 +13,8 @@ ms.assetid: 5b84c2a5-18db-44dc-9c5c-f83664672e45 # List.foldBack2<'T1,'T2,'State> Function (F#) -Applies a function to corresponding elements of two collections, threading an accumulator argument through the computation. The collections must have identical sizes. If the input function is `f` and the elements are `i0...iN` and `j0...jN`, then this function computes `f i0 j0 (...(f iN jN s))`. +Applies a function to corresponding elements of two lists, threading an accumulator argument through the computation. The lists must have equal lengths. +If the input function is `f` and the elements are `i0...iN` and `j0...jN`, then this function computes `f i0 j0 (...(f iN jN s))`. **Namespace/Module Path:** Microsoft.FSharp.Collections.List @@ -58,16 +59,15 @@ Type: **'State** The initial state. +## Return Value + +The final state value. ## Exceptions |Exception|Condition| |----|----| -|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the list is empty.| - -## Return Value - -The final state value. +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the lists differ in length.| ## Remarks This function is named `FoldBack2` in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.forall2['t1,'t2]-function-[fsharp].md b/docs/conceptual/list.forall2['t1,'t2]-function-[fsharp].md index 5c17da0b..dc686a96 100644 --- a/docs/conceptual/list.forall2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/list.forall2['t1,'t2]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: a125b984-5e21-4dc4-9734-b0b796807401 # List.forall2<'T1,'T2> Function (F#) -Tests if all corresponding elements of the collection satisfy the given predicate pairwise. +Tests if all corresponding elements of the lists satisfy the given predicate pairwise. The lists must have equal lengths. **Namespace/Module Path:** Microsoft.FSharp.Collections.List diff --git a/docs/conceptual/list.iter2['t1,'t2]-function-[fsharp].md b/docs/conceptual/list.iter2['t1,'t2]-function-[fsharp].md index f1d4c930..c1ab7487 100644 --- a/docs/conceptual/list.iter2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/list.iter2['t1,'t2]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 54b3700b-9b7a-46be-8dba-fbdeef5b5353 # List.iter2<'T1,'T2> Function (F#) -Applies the given function to two collections simultaneously. The collections must have identical size. +Applies the given function to two lists simultaneously. The lists must have equal lengths. **Namespace/Module Path:** Microsoft.FSharp.Collections.List diff --git a/docs/conceptual/list.iteri2['t1,'t2]-function-[fsharp].md b/docs/conceptual/list.iteri2['t1,'t2]-function-[fsharp].md index 3f9adabe..4af1d9dd 100644 --- a/docs/conceptual/list.iteri2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/list.iteri2['t1,'t2]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 183c14eb-67b1-4550-a5ec-a417a61261a9 # List.iteri2<'T1,'T2> Function (F#) -Applies the given function to two collections simultaneously. The collections must have identical size. The integer passed to the function indicates the index of element. +Applies the given function to two lists simultaneously. The lists must have equal lengths. The integer passed to the function indicates the index of element. **Namespace/Module Path:** Microsoft.FSharp.Collections.List diff --git a/docs/conceptual/list.map2['t1,'t2,'u]-function-[fsharp].md b/docs/conceptual/list.map2['t1,'t2,'u]-function-[fsharp].md index 00ae7e60..23f9b644 100644 --- a/docs/conceptual/list.map2['t1,'t2,'u]-function-[fsharp].md +++ b/docs/conceptual/list.map2['t1,'t2,'u]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: aa680673-f521-47b3-bd42-29a526d93904 # List.map2<'T1,'T2,'U> Function (F#) -Creates a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise. +Creates a new list whose elements are the results of applying the given function to the corresponding elements of the two lists pairwise. The lists must have equal lengths. **Namespace/Module Path:** Microsoft.FSharp.Collections.List @@ -55,6 +55,12 @@ The second input list. The list of resulting elements. +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks The two lists *list1* and *list2* must have the same length. If they don't, an exception is thrown. diff --git a/docs/conceptual/list.map3['t1,'t2,'t3,'u]-function-[fsharp].md b/docs/conceptual/list.map3['t1,'t2,'t3,'u]-function-[fsharp].md index c255aebb..bff6ac13 100644 --- a/docs/conceptual/list.map3['t1,'t2,'t3,'u]-function-[fsharp].md +++ b/docs/conceptual/list.map3['t1,'t2,'t3,'u]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 4ebaa36f-1162-419f-ba5e-18f851a63c01 # List.map3<'T1,'T2,'T3,'U> Function (F#) -Creates a new collection whose elements are the results of applying the given function to the corresponding elements of the three collections simultaneously. +Creates a new list whose elements are the results of applying the given function to the corresponding elements of the three lists simultaneously. The lists must have equal lengths. **Namespace/Module Path**: Microsoft.FSharp.Collections.List @@ -60,9 +60,15 @@ The third input list. ## Return Value -he list of transformed elements. +The list of transformed elements. + +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks -The three lists *list1*, *list2*, and *list3* must all have the same length. If they don't, an exception is thrown. This function is named `Map3` in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.mapi2['t1,'t2,'u]-function-[fsharp].md b/docs/conceptual/list.mapi2['t1,'t2,'u]-function-[fsharp].md index 1c27493d..9f2bf713 100644 --- a/docs/conceptual/list.mapi2['t1,'t2,'u]-function-[fsharp].md +++ b/docs/conceptual/list.mapi2['t1,'t2,'u]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 18316575-2a76-4312-a934-818bebb4ae3a # List.mapi2<'T1,'T2,'U> Function (F#) -Like [`List.mapi`](https://msdn.microsoft.com/library/284b9234-3d26-409b-b328-ac79638d9e14), but mapping corresponding elements from two lists of equal length. +Like [`List.mapi`](https://msdn.microsoft.com/library/284b9234-3d26-409b-b328-ac79638d9e14), but mapping corresponding elements from two lists. The lists must have equal lengths. **Namespace/Module Path:** Microsoft.FSharp.Collections.List @@ -55,6 +55,12 @@ The second input list. The list of transformed elements. +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks This function is named `MapIndexed2` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.zip3['t1,'t2,'t3]-function-[fsharp].md b/docs/conceptual/list.zip3['t1,'t2,'t3]-function-[fsharp].md index 304e6d26..28f931a9 100644 --- a/docs/conceptual/list.zip3['t1,'t2,'t3]-function-[fsharp].md +++ b/docs/conceptual/list.zip3['t1,'t2,'t3]-function-[fsharp].md @@ -55,6 +55,12 @@ The third input list. A single list containing triples of matching elements from the input lists. +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks This function is named `Zip3` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/list.zip['t1,'t2]-function-[fsharp].md b/docs/conceptual/list.zip['t1,'t2]-function-[fsharp].md index b9da0ea7..af7a5333 100644 --- a/docs/conceptual/list.zip['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/list.zip['t1,'t2]-function-[fsharp].md @@ -48,6 +48,12 @@ The second input list. A single list containing pairs of matching elements from the input lists. +## Exceptions + +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input lists differ in length.| + ## Remarks This function is named `Zip` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/map.pick['key,'t,'u]-function-[fsharp].md b/docs/conceptual/map.pick['key,'t,'u]-function-[fsharp].md index 95291e01..226c3669 100644 --- a/docs/conceptual/map.pick['key,'t,'u]-function-[fsharp].md +++ b/docs/conceptual/map.pick['key,'t,'u]-function-[fsharp].md @@ -13,7 +13,9 @@ ms.assetid: aa03cc11-bddf-44e4-9264-e517733c3ded # Map.pick<'Key,'T,'U> Function (F#) -Searches the map looking for the first element where the given function returns a `Some` value +Searches the map looking for the first element where the given function returns a `Some` value. If the function returns `None` for all elements, raises `System.Collections.Generic.KeyNotFoundException`. + + **Namespace/Module Path**: Microsoft.FSharp.Collections.Map @@ -44,6 +46,10 @@ Type: [Map](https://msdn.microsoft.com/library/975316ea-55e3-4987-9994-90897ad45 The input map. +## Exceptions +|Exception|Condition| +|----|----| +|[KeyNotFoundException](https://msdn.microsoft.com/library/system.collections.generic.keynotfoundexception.aspx)|Thrown if the function returns `None` for all elements.| ## Return Value diff --git a/docs/conceptual/operators.atan2[^t1,'t2]-function-[fsharp].md b/docs/conceptual/operators.atan2[^t1,'t2]-function-[fsharp].md index 6fe514cf..68459ef4 100644 --- a/docs/conceptual/operators.atan2[^t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/operators.atan2[^t1,'t2]-function-[fsharp].md @@ -13,7 +13,7 @@ ms.assetid: 1b76593b-1590-434e-b38d-a9066f095a66 # Operators.atan2<^T1,'T2> Function (F#) -Inverse tangent of `x/y` where `x` and `y` are specified separately. +Inverse tangent of `y/x` where `x` and `y` are specified separately. **Namespace/Module Path:** Microsoft.FSharp.Core.Operators diff --git a/docs/conceptual/operators.string[^t]-function-[fsharp].md b/docs/conceptual/operators.string[^t]-function-[fsharp].md index 0f6fd4b0..47aa57ca 100644 --- a/docs/conceptual/operators.string[^t]-function-[fsharp].md +++ b/docs/conceptual/operators.string[^t]-function-[fsharp].md @@ -42,12 +42,14 @@ The input value. The converted string. ## Remarks -For standard integer and floating point values the `System.Object.ToString` conversion uses `System.Globalization.CultureInfo.InvariantCulture`. +This function is null-safe, null values will return `String.Empty`. -This function is named `ToString` in compiled assembly. If you are accessing the function from a language other than F#, or through reflection, use this name. +For standard integer, decimal, floating point and DateTime values, and any other value that implementens `System.IFormattable`, this function calls the `System.IFormattable.ToString` method instead, with the culture set to `System.Globalization.CultureInfo.InvariantCulture`. + +This function is named `ToString` in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 10, Windows 8, Windows 7, Windows Server 2016, Windows Server 2012, Windows Server 2008 R2 ## Version Information **F# Core Library Versions** diff --git a/docs/conceptual/quotations.patterns-module-[fsharp].md b/docs/conceptual/quotations.patterns-module-[fsharp].md index 4de0b0f2..a99aabd7 100644 --- a/docs/conceptual/quotations.patterns-module-[fsharp].md +++ b/docs/conceptual/quotations.patterns-module-[fsharp].md @@ -37,7 +37,7 @@ module Patterns |[Call](https://msdn.microsoft.com/library/30fe9a55-5a76-452d-9334-3324a6837ae7)
`: Expr -> (Expr option * MethodInfo * Expr list) option`|Recognizes expressions that represent calls to static and instance methods, and functions defined in modules.| |[Coerce](https://msdn.microsoft.com/library/bd5f79c4-5245-4e84-b1a7-b221928d47ae)
`: Expr -> (Expr * Type) option`|Recognizes expressions that represent coercions from one type to another.| |[DefaultValue](https://msdn.microsoft.com/library/b71bf5a2-dcd6-4612-9b2d-d7f8a52d35fa)
`: Expr -> Type option`|Recognizes expressions that represent invocations of a default constructor of a structure.| -|[FieldGet](https://msdn.microsoft.com/library/99d0c3d6-da53-4ebd-a288-c7be83c00daf)
`: Expr -> (Expr option * FieldInfo)`|Recognizes expressions that represent getting a static or instance field.| +|[FieldGet](https://msdn.microsoft.com/library/99d0c3d6-da53-4ebd-a288-c7be83c00daf)
`: Expr -> (Expr option * FieldInfo) option`|Recognizes expressions that represent getting a static or instance field.| |[FieldSet](https://msdn.microsoft.com/library/44ebb5e4-e79d-4ae1-9e17-704b3f33bd32)
`: Expr -> (Expr option * FieldInfo * Expr) option`|Recognizes expressions that represent setting a static or instance field.| |[ForIntegerRangeLoop](https://msdn.microsoft.com/library/bf775c49-6b5b-4a45-97bf-9caa678e743f)
`: Expr -> (Var * Expr * Expr * Expr) option`|Recognizes expressions that represent loops over integer ranges.| |[IfThenElse](https://msdn.microsoft.com/library/90f83178-ad5e-4a9f-b657-50e955e2738b)
`: Expr -> (Expr * Expr * Expr) option`|Recognizes expressions that represent conditionals.| @@ -62,7 +62,7 @@ module Patterns |[Value](https://msdn.microsoft.com/library/c8c35d6d-0068-4faa-b7de-cd571991adee)
`: Expr -> (obj * Type) option`|Recognizes expressions that represent a constant value.| |[VarSet](https://msdn.microsoft.com/library/4fb87a56-d508-4a0a-a2b4-43a84d127d7a)
`: Expr -> (Var * Expr) option`|Recognizes expressions that represent setting a mutable variable.| |[Var](https://msdn.microsoft.com/library/fd28da2c-0ba3-4db2-85bc-73f7c23114e2)
`: Expr -> Var option`|Recognizes expressions that represent a variable.| -|[WhileLoop](https://msdn.microsoft.com/library/0df8dd3c-faab-4873-ab5c-eb5b0159f8b9)
`: Expr -> (Expr * Expr) option**|Recognizes expressions that represent while loops.| +|[WhileLoop](https://msdn.microsoft.com/library/0df8dd3c-faab-4873-ab5c-eb5b0159f8b9)
`: Expr -> (Expr * Expr) option`|Recognizes expressions that represent while loops.| ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 diff --git a/docs/conceptual/reflection.fsharptype-class-[fsharp].md b/docs/conceptual/reflection.fsharptype-class-[fsharp].md index 3163a801..575642a0 100644 --- a/docs/conceptual/reflection.fsharptype-class-[fsharp].md +++ b/docs/conceptual/reflection.fsharptype-class-[fsharp].md @@ -59,7 +59,7 @@ end |[IsRecord](https://msdn.microsoft.com/library/bb3b2a3b-51b5-4a8b-82fe-d61282becead)|Returns `true` if the specified type is a representation of an F# record type.| |[IsTuple](https://msdn.microsoft.com/library/dc627b14-e1a6-4ac8-b0d2-25e9984f87b7)|Returns `true` if the specified type is a representation of an F# tuple type.| |[IsUnion](https://msdn.microsoft.com/library/529743e4-c456-429f-934f-ab8610166abb)|Returns `true` if the specified type is a representation of an F# union type or the runtime type of a value of that type.| -|[MakeFunctionType](https://msdn.microsoft.com/library/568814c9-1099-439d-abd1-de4a0b923476)|Returns a `System.Type``object` representing the F# function type with the given domain and range.| +|[MakeFunctionType](https://msdn.microsoft.com/library/568814c9-1099-439d-abd1-de4a0b923476)|Returns a `System.Type` object representing the F# function type with the given domain and range.| |[MakeTupleType](https://msdn.microsoft.com/library/d6ed5a4f-390f-425d-8a21-66271782c417)|Returns a `System.Type` representing an F# tuple type with the given element types.| ## Platforms diff --git a/docs/conceptual/reflection.unioncaseinfo-class-[fsharp].md b/docs/conceptual/reflection.unioncaseinfo-class-[fsharp].md index a15f974e..bcff263e 100644 --- a/docs/conceptual/reflection.unioncaseinfo-class-[fsharp].md +++ b/docs/conceptual/reflection.unioncaseinfo-class-[fsharp].md @@ -27,7 +27,8 @@ Represents a case of a discriminated union type. type UnionCaseInfo = class member this.GetCustomAttributes : Type -> obj [] -member this.GetCustomAttributes : unit -> obj [] member this.GetCustomAttributesData : unit -> IList +member this.GetCustomAttributes : unit -> obj [] +member this.GetCustomAttributesData : unit -> IList member this.GetFields : unit -> PropertyInfo [] member this.DeclaringType : Type member this.Name : string diff --git a/docs/conceptual/runtimehelpers.leafexpressionconverter-module-[fsharp].md b/docs/conceptual/runtimehelpers.leafexpressionconverter-module-[fsharp].md index d7850622..928c61da 100644 --- a/docs/conceptual/runtimehelpers.leafexpressionconverter-module-[fsharp].md +++ b/docs/conceptual/runtimehelpers.leafexpressionconverter-module-[fsharp].md @@ -25,11 +25,11 @@ Contains functions that help implement F# query expressions. ```fsharp module LeafExpressionConverter EvaluateQuotation : Expr -> obj - ImplicitExpressionConversionHelper : 'T -> Expression<'T> - MemberInitializationHelper : 'T -> 'T - QuotationToExpression : Expr -> Expression - QuotationToLambdaExpression : Expr<'T> -> Expression<'T> - SubstHelper : Expr * Var [] * obj [] -> Expr<'T> + ImplicitExpressionConversionHelper : 'T -> Expression<'T> + MemberInitializationHelper : 'T -> 'T + QuotationToExpression : Expr -> Expression + QuotationToLambdaExpression : Expr<'T> -> Expression<'T> + SubstHelper : Expr * Var [] * obj [] -> Expr<'T> ``` ## Values diff --git a/docs/conceptual/seq.concat['collection,'t]-function-[fsharp].md b/docs/conceptual/seq.concat['collection,'t]-function-[fsharp].md index d5b15f59..663398c8 100644 --- a/docs/conceptual/seq.concat['collection,'t]-function-[fsharp].md +++ b/docs/conceptual/seq.concat['collection,'t]-function-[fsharp].md @@ -59,7 +59,8 @@ The following code shows how to use Seq.concat. **Output** ``` -1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 +1 2 3 4 5 6 7 8 9 10 +1 2 3 4 5 6 7 8 9 ``` ## Platforms diff --git a/docs/conceptual/snippets/fslists/snippet41.fs b/docs/conceptual/snippets/fslists/snippet41.fs index f8c517eb..e58ef6ea 100644 --- a/docs/conceptual/snippets/fslists/snippet41.fs +++ b/docs/conceptual/snippets/fslists/snippet41.fs @@ -1,8 +1,8 @@ -let sumListBack list = List.foldBack (fun acc elem -> acc + elem) list 0 +let sumListBack list = List.foldBack (fun elem acc -> acc + elem) list 0 printfn "%d" (sumListBack [1; 2; 3]) // For a calculation in which the order of traversal is important, fold and foldBack have different // results. For example, replacing foldBack with fold in the copyList function // produces a function that reverses the list, rather than copying it. let copyList list = List.foldBack (fun elem acc -> elem::acc) list [] -printfn "%A" (copyList [1 .. 10]) \ No newline at end of file +printfn "%A" (copyList [1 .. 10]) diff --git a/docs/conceptual/strings-[fsharp].md b/docs/conceptual/strings-[fsharp].md index f6ccb962..5251527c 100644 --- a/docs/conceptual/strings-[fsharp].md +++ b/docs/conceptual/strings-[fsharp].md @@ -18,7 +18,7 @@ The `string` type represents immutable text as a sequence of Unicode characters. ## Remarks -String literals are delimited by the quotation mark (") character. The backslash character (\) is used to encode certain special characters. The backslash and the next character together are known as an *escape sequence*. Escape sequences supported in F# string literals are shown in the following table. +String literals are delimited by the quotation mark (") character. The backslash character (\\) is used to encode certain special characters. The backslash and the next character together are known as an *escape sequence*. Escape sequences supported in F# string literals are shown in the following table. @@ -28,7 +28,7 @@ String literals are delimited by the quotation mark (") character. The backslash |Newline|\n| |Carriage return|\r| |Tab|\t| -|Backslash|\\| +|Backslash|\\\\| |Quotation mark|\"| |Apostrophe|\'| |Unicode character|\u*XXXX* or \U*XXXXXXXX* (where *X* indicates a hexadecimal digit)| @@ -88,4 +88,4 @@ By using the `Chars` property of `System.String`, you can access the individual Additional functionality for string handling is included in the `String` module in the `FSharp.Core` namespace. For more information, see [Core.String Module (F#)](Core.String-Module-%5BFSharp%5D.md). ## See Also -[F# Language Reference](FSharp-Language-Reference.md) \ No newline at end of file +[F# Language Reference](FSharp-Language-Reference.md) diff --git a/docs/conceptual/walkthrough-using-visual-fsharp-to-create,-debug,-and-deploy-an-application.md b/docs/conceptual/walkthrough-using-visual-fsharp-to-create,-debug,-and-deploy-an-application.md index 19f7692c..d662c04d 100644 --- a/docs/conceptual/walkthrough-using-visual-fsharp-to-create,-debug,-and-deploy-an-application.md +++ b/docs/conceptual/walkthrough-using-visual-fsharp-to-create,-debug,-and-deploy-an-application.md @@ -263,10 +263,8 @@ Notice the following: ## Next Steps -Get started writing F# code by reading [Walkthrough: Your First F# Program](Walkthrough-Your-First-FSharp-Program.md), or learn about functions in F# by reading [Functions as First-Class Values (F#)](Functions-as-First-Class-Values-%5BFSharp%5D.md). You can explore the F# language by reading the [F# Language Reference](FSharp-Language-Reference.md). +Get started writing F# code by reading [Walkthrough: Your First F# Program](https://docs.microsoft.com/dotnet/fsharp/get-started/get-started-visual-studio), or learn about functions in F# by reading [Functions as First-Class Values (F#)](Functions-as-First-Class-Values-%5BFSharp%5D.md). You can explore the F# language by reading the [F# Language Reference](FSharp-Language-Reference.md). ## See Also [Visual F# Samples and Walkthroughs](Visual-FSharp-Samples-and-Walkthroughs.md) - -[Visual F# Samples and Walkthroughs](Visual-FSharp-Samples-and-Walkthroughs.md) \ No newline at end of file