From f011de0b0763b957addac15214a5178fa3501f99 Mon Sep 17 00:00:00 2001 From: ReedCopsey Date: Fri, 20 May 2016 11:56:19 -0700 Subject: [PATCH] Cleanup of "array" docs In regards to Issue #61 --- ...ption.innerexceptions-property-[fsharp].md | 14 +- .../arithmetic-operators-[fsharp].md | 9 +- ...rray.exists2['t1,'t2]-function-[fsharp].md | 15 +- .../array.find['t]-function-[fsharp].md | 14 +- .../array.findindex['t]-function-[fsharp].md | 20 +- ...fold2['t1,'t2,'state]-function-[fsharp].md | 29 +- ...back2['t1,'t2,'state]-function-[fsharp].md | 29 +- ...rray.forall2['t1,'t2]-function-[fsharp].md | 23 +- .../array.iter2['t1,'t2]-function-[fsharp].md | 26 +- ...array.iteri2['t1,'t2]-function-[fsharp].md | 56 +-- .../array.length['t]-function-[fsharp].md | 39 +- ...rray.map2['t1,'t2,'u]-function-[fsharp].md | 29 +- ...ray.mapi2['t1,'t2,'u]-function-[fsharp].md | 28 +- .../array.max['t]-function-[fsharp].md | 35 +- .../array.maxby['t,'u]-function-[fsharp].md | 38 +- .../array.min['t]-function-[fsharp].md | 36 +- .../array.minby['t,'u]-function-[fsharp].md | 39 +- .../array.pick['t,'u]-function-[fsharp].md | 35 +- .../array.reduce['t]-function-[fsharp].md | 34 +- .../array.reduceback['t]-function-[fsharp].md | 35 +- ...ray.zip3['t1,'t2,'t3]-function-[fsharp].md | 33 +- .../array.zip['t1,'t2]-function-[fsharp].md | 33 +- .../array2d.blit['t]-function-[fsharp].md | 43 +-- .../array2d.create['t]-function-[fsharp].md | 33 +- ...ray2d.createbased['t]-function-[fsharp].md | 35 +- .../array2d.get['t]-function-[fsharp].md | 33 +- .../array2d.init['t]-function-[fsharp].md | 34 +- ...array2d.initbased['t]-function-[fsharp].md | 35 +- .../array2d.set['t]-function-[fsharp].md | 35 +- ...rray2d.zerocreate['t]-function-[fsharp].md | 30 +- ...d.zerocreatebased['t]-function-[fsharp].md | 33 +- docs/conceptual/arrays-[fsharp].md | 334 +++--------------- 32 files changed, 250 insertions(+), 1044 deletions(-) diff --git a/docs/conceptual/aggregateexception.innerexceptions-property-[fsharp].md b/docs/conceptual/aggregateexception.innerexceptions-property-[fsharp].md index cd08d725..1abd544c 100644 --- a/docs/conceptual/aggregateexception.innerexceptions-property-[fsharp].md +++ b/docs/conceptual/aggregateexception.innerexceptions-property-[fsharp].md @@ -18,28 +18,20 @@ Gets a read-only collection of the **Exception** instances that caused the curre **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ```fsharp - // Signature: member this.InnerExceptions : ReadOnlyCollection // Usage: aggregateException.InnerExceptions - ``` - - - -**A T:System.Collections.ObjectModel.ReadOnlyCollection`1 that contains the inner exceptions.** +**A System.Collections.ObjectModel.ReadOnlyCollection<Exception> that contains the inner exceptions.** ## Remarks -This API is provided for use only with the F# Core Library Versions that targets .NET Framework 2.0. If you are using .NET Framework 4, use the .NET Framework 4 API with the same name, **P:System.AggregateException.InnerExceptions**. +This API is provided for use only with the F# Core Library Versions that targets .NET Framework 2.0. If you are using .NET Framework 4, use the .NET Framework 4 API with the same name, **System.AggregateException.InnerExceptions**. ## Platforms @@ -52,8 +44,6 @@ Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 Supported in: 2.0 - - ## See Also [System.AggregateException Class (F#)](System.AggregateException-Class-%5BFSharp%5D.md) diff --git a/docs/conceptual/arithmetic-operators-[fsharp].md b/docs/conceptual/arithmetic-operators-[fsharp].md index cb3b8bed..8666c857 100644 --- a/docs/conceptual/arithmetic-operators-[fsharp].md +++ b/docs/conceptual/arithmetic-operators-[fsharp].md @@ -14,18 +14,15 @@ ms.assetid: 75ddcfa3-564e-4382-80a3-f9da73d0f0ea This topic describes arithmetic operators that are available in the F# language. - ## Summary of Binary Arithmetic Operators The following table summarizes the binary arithmetic operators that are available for unboxed integral and floating-point types. - - |Binary operator|Notes| |---------------|-----| |**+** (addition, plus)|Unchecked. Possible overflow condition when numbers are added together and the sum exceeds the maximum absolute value supported by the type.| |**-** (subtraction, minus)|Unchecked. Possible underflow condition when unsigned types are subtracted, or when floating-point values are too small to be represented by the type.| |***** (multiplication, times)|Unchecked. Possible overflow condition when numbers are multiplied and the product exceeds the maximum absolute value supported by the type.| -|**/** (division, divided by)|Division by zero causes a **T:System.DivideByZeroException** for integral types. For floating-point types, division by zero gives you the special floating-point values **+Infinity** or **-Infinity**. There is also a possible underflow condition when a floating-point number is too small to be represented by the type.| +|**/** (division, divided by)|Division by zero causes a **System.DivideByZeroException** for integral types. For floating-point types, division by zero gives you the special floating-point values **+Infinity** or **-Infinity**. There is also a possible underflow condition when a floating-point number is too small to be represented by the type.| |**%** (modulus, mod)|Returns the remainder of a division operation. The sign of the result is the same as the sign of the first operand.| |****** (exponentiation, to the power of)|Possible overflow condition when the result exceeds the maximum absolute value for the type.

The exponentiation operator works only with floating-point types.| @@ -58,9 +55,9 @@ Floating-point numbers should never be directly compared for equality, because t |**<>** (not equal)|This is a generic operator.| ## Overloaded and Generic Operators -All of the operators discussed in this topic are defined in the **Microsoft.FSharp.Core.Operators** namespace. Some of the operators are defined by using statically resolved type parameters. This means that there are individual definitions for each specific type that works with that operator. All of the unary and binary arithmetic and bitwise operators are in this category. The comparison operators are generic and therefore work with any type, not just primitive arithmetic types. Discriminated union and record types have their own custom implementations that are generated by the F# compiler. Class types use the method **M:System.Object.Equals(System.Object)**. +All of the operators discussed in this topic are defined in the **Microsoft.FSharp.Core.Operators** namespace. Some of the operators are defined by using statically resolved type parameters. This means that there are individual definitions for each specific type that works with that operator. All of the unary and binary arithmetic and bitwise operators are in this category. The comparison operators are generic and therefore work with any type, not just primitive arithmetic types. Discriminated union and record types have their own custom implementations that are generated by the F# compiler. Class types use the method **System.Object.Equals(System.Object)**. -The generic operators are customizable. To customize the comparison functions, override **M:System.Object.Equals(System.Object)** to provide your own custom equality comparison, and then implement **T:System.IComparable**. The **T:System.IComparable** interface has a single method, the **M:System.IComparable.CompareTo(System.Object)** method. +The generic operators are customizable. To customize the comparison functions, override **System.Object.Equals(System.Object)** to provide your own custom equality comparison, and then implement **System.IComparable**. The **System.IComparable** interface has a single method, the **System.IComparable.CompareTo(System.Object)** method. ## Operators and Type Inference diff --git a/docs/conceptual/array.exists2['t1,'t2]-function-[fsharp].md b/docs/conceptual/array.exists2['t1,'t2]-function-[fsharp].md index 49e3d5c9..68aa267e 100644 --- a/docs/conceptual/array.exists2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/array.exists2['t1,'t2]-function-[fsharp].md @@ -18,11 +18,8 @@ Tests if any pair of corresponding elements of the arrays satisfies the given pr **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ```fsharp // Signature: @@ -30,40 +27,30 @@ Array.exists2 : ('T1 -> 'T2 -> bool) -> 'T1 [] -> 'T2 [] -> bool // Usage: Array.exists2 predicate array1 array2 - - ``` - - #### Parameters *predicate* Type: **'T1 -> 'T2 ->**[bool](http://msdn.microsoft.com/en-us/library/89c0cf9c-49ce-4207-a3be-555851a67dd5) - The function to test the input elements. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - ## Return value **true** if any result from predicate is true. Otherwise, **false**. ## 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. Otherwise, if one collection is longer than the other then the **T:System.ArgumentException** exception is raised. Otherwise, **false** is returned. +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. Otherwise, if one collection is longer than the other then the **System.ArgumentException** exception is raised. Otherwise, **false** is returned. This function is named **Exists2** in compiled assemblies. If you are accessing the member from a language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/array.find['t]-function-[fsharp].md b/docs/conceptual/array.find['t]-function-[fsharp].md index ce9c947a..ff55592d 100644 --- a/docs/conceptual/array.find['t]-function-[fsharp].md +++ b/docs/conceptual/array.find['t]-function-[fsharp].md @@ -12,17 +12,14 @@ ms.assetid: 7c9c2263-06e6-4a3f-b080-20bf3cf4ebd9 # Array.find<'T> Function (F#) -Returns the first element for which the given function returns **true**. Raise **T:System.Collections.Generic.KeyNotFoundException** if no such element exists. +Returns the first element for which the given function returns **true**. Raise **System.Collections.Generic.KeyNotFoundException** if no such element exists. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ```fsharp // Signature: @@ -30,23 +27,17 @@ Array.find : ('T -> bool) -> 'T [] -> 'T // Usage: Array.find predicate array - - ``` - #### Parameters *predicate* Type: **'T ->**[bool](http://msdn.microsoft.com/library/89c0cf9c-49ce-4207-a3be-555851a67dd5) - The function to test the input elements. - *array* Type: **'T**[[]](http://msdn.microsoft.com/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. ## Exceptions @@ -76,9 +67,6 @@ Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.findindex['t]-function-[fsharp].md b/docs/conceptual/array.findindex['t]-function-[fsharp].md index f459ba77..f33fb166 100644 --- a/docs/conceptual/array.findindex['t]-function-[fsharp].md +++ b/docs/conceptual/array.findindex['t]-function-[fsharp].md @@ -12,52 +12,34 @@ ms.assetid: 32c37f7f-32f4-47fd-95c7-78e8a85045ed # Array.findIndex<'T> Function (F#) -Returns the index of the first element in the array that satisfies the given predicate. Raise **T:System.Collections.Generic.KeyNotFoundException** if none of the elements satisfy the predicate. +Returns the index of the first element in the array that satisfies the given predicate. Raise **System.Collections.Generic.KeyNotFoundException** if none of the elements satisfy the predicate. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.findIndex : ('T -> bool) -> 'T [] -> int // Usage: Array.findIndex predicate array - - ``` - - - #### Parameters *predicate* Type: **'T ->**[bool](http://msdn.microsoft.com/en-us/library/89c0cf9c-49ce-4207-a3be-555851a67dd5) - The function to test the input elements. - *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. - - -**exceptions tag is not supported!!!!** **The index of the first element in the array that satisfies the given predicate.** ## Remarks This function is named **FindIndex** 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/array.fold2['t1,'t2,'state]-function-[fsharp].md b/docs/conceptual/array.fold2['t1,'t2,'state]-function-[fsharp].md index 20a63681..22c4f602 100644 --- a/docs/conceptual/array.fold2['t1,'t2,'state]-function-[fsharp].md +++ b/docs/conceptual/array.fold2['t1,'t2,'state]-function-[fsharp].md @@ -12,66 +12,43 @@ ms.assetid: 493ad9c8-9c14-45b4-9689-03ad9b9639b5 # Array.fold2<'T1,'T2,'State> Function (F#) -Applies a function to pairs of elements drawn from the two collections, left-to-right, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise **T:System.ArgumentException** is raised. +Applies a function to pairs of elements drawn from the two collections, left-to-right, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise **System.ArgumentException** is raised. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.fold2 : ('State -> 'T1 -> 'T2 -> 'State) -> 'State -> 'T1 [] -> 'T2 [] -> 'State // Usage: Array.fold2 folder state array1 array2 - - ``` - - - - #### Parameters *folder* Type: **'State -> 'T1 -> 'T2 -> 'State** - The function to update the state given the input elements. - *state* Type: **'State** - The initial state. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - - -**exceptions tag is not supported!!!!** **The final state.** ## Remarks This function is named **Fold2** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. @@ -83,15 +60,11 @@ This function is named **Fold2** in compiled assemblies. If you are accessing th ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.foldback2['t1,'t2,'state]-function-[fsharp].md b/docs/conceptual/array.foldback2['t1,'t2,'state]-function-[fsharp].md index f58ac719..35507f90 100644 --- a/docs/conceptual/array.foldback2['t1,'t2,'state]-function-[fsharp].md +++ b/docs/conceptual/array.foldback2['t1,'t2,'state]-function-[fsharp].md @@ -12,66 +12,43 @@ ms.assetid: 2c75b6cb-89fa-4184-85cc-18236a885e6f # Array.foldBack2<'T1,'T2,'State> Function (F#) -Apply a function to pairs of elements drawn from the two collections, right-to-left, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise an **T:System.ArgumentException** is raised. +Apply a function to pairs of elements drawn from the two collections, right-to-left, threading an accumulator argument through the computation. The two input arrays must have the same lengths, otherwise an **System.ArgumentException** is raised. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.foldBack2 : ('T1 -> 'T2 -> 'State -> 'State) -> 'T1 [] -> 'T2 [] -> 'State -> 'State // Usage: Array.foldBack2 folder array1 array2 state - - ``` - - - - #### Parameters *folder* Type: **'T1 -> 'T2 -> 'State -> 'State** - The function to update the state given the input elements. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - *state* Type: **'State** - The initial state. - - -**exceptions tag is not supported!!!!** **The final state.** ## Remarks This function is named **FoldBack2** in the .NET assembly. If accessing the member from a .NET language other than F#, or through reflection, use this name. @@ -83,15 +60,11 @@ This function is named **FoldBack2** in the .NET assembly. If accessing the memb ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.forall2['t1,'t2]-function-[fsharp].md b/docs/conceptual/array.forall2['t1,'t2]-function-[fsharp].md index d0fa25df..8f65768e 100644 --- a/docs/conceptual/array.forall2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/array.forall2['t1,'t2]-function-[fsharp].md @@ -18,56 +18,35 @@ Tests if all corresponding elements of the array satisfy the given predicate pai **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.forall2 : ('T1 -> 'T2 -> bool) -> 'T1 [] -> 'T2 [] -> bool // Usage: Array.forall2 predicate array1 array2 - - ``` - - - - #### Parameters *predicate* Type: **'T1 -> 'T2 ->**[bool](http://msdn.microsoft.com/en-us/library/89c0cf9c-49ce-4207-a3be-555851a67dd5) - The function to test the input elements. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - - -**exceptions tag is not supported!!!!** **true if all of the array elements satisfy the predicate. Otherwise, returns false.** ## 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 **false** then the overall result is **false** and no further elements are tested. Otherwise, if one collection is longer than the other, then the **T:System.ArgumentException** exception is raised. +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 **false** then the overall result is **false** and no further elements are tested. Otherwise, if one collection is longer than the other, then the **System.ArgumentException** exception is raised. This function is named **ForAll2** in compiled assemblies. If accessing the function from a language other than F#, or through reflection, use this name. diff --git a/docs/conceptual/array.iter2['t1,'t2]-function-[fsharp].md b/docs/conceptual/array.iter2['t1,'t2]-function-[fsharp].md index 37a9ae95..ed9d06ac 100644 --- a/docs/conceptual/array.iter2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/array.iter2['t1,'t2]-function-[fsharp].md @@ -12,60 +12,38 @@ ms.assetid: fc078eab-8c66-45d6-905a-eb55af3116c8 # Array.iter2<'T1,'T2> Function (F#) -Applies the given function to pair of elements drawn from matching indices in two arrays. The two arrays must have the same lengths, otherwise an **T:System.ArgumentException** is raised. +Applies the given function to pair of elements drawn from matching indices in two arrays. The two arrays must have the same lengths, otherwise an **System.ArgumentException** is raised. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.iter2 : ('T1 -> 'T2 -> unit) -> 'T1 [] -> 'T2 [] -> unit // Usage: Array.iter2 action array1 array2 - - ``` - - - - #### Parameters *action* Type: **'T1 -> 'T2 ->**[unit](http://msdn.microsoft.com/en-us/library/00b837c2-6c8a-483a-87d3-0479c64037a7) - The function to apply. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - - -**exceptions tag is not supported!!!!** - ## Remarks This function is named **Iterate2** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. @@ -94,8 +72,6 @@ Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 Supported in: 2.0, 4.0, Portable - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.iteri2['t1,'t2]-function-[fsharp].md b/docs/conceptual/array.iteri2['t1,'t2]-function-[fsharp].md index 37672310..f6a8314f 100644 --- a/docs/conceptual/array.iteri2['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/array.iteri2['t1,'t2]-function-[fsharp].md @@ -12,90 +12,68 @@ ms.assetid: d0dea2a2-670c-4dd3-a562-91eb02792be3 # Array.iteri2<'T1,'T2> Function (F#) -Applies the given function to a pair of elements drawn from matching indices in two arrays, also passing the index of the elements. The two arrays must have the same lengths, otherwise **T:System.ArgumentException** is raised. +Applies the given function to a pair of elements drawn from matching indices in two arrays, also passing the index of the elements. The two arrays must have the same lengths, otherwise **System.ArgumentException** is raised. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.iteri2 : (int -> 'T1 -> 'T2 -> unit) -> 'T1 [] -> 'T2 [] -> unit // Usage: Array.iteri2 action array1 array2 - - ``` - - - - #### Parameters *action* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**-> 'T1 -> 'T2 ->**[unit](http://msdn.microsoft.com/en-us/library/00b837c2-6c8a-483a-87d3-0479c64037a7) - The function to apply to each index and pair of elements. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - - -**exceptions tag is not supported!!!!** - ## Remarks This function is named **IterateIndexed2** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code examples shows the differences between [Array.iter](http://msdn.microsoft.com/en-us/library/94eba0f1-ecd7-459f-b89f-ed2a2923e516), [Array.iter2](http://msdn.microsoft.com/en-us/library/018aa9b9-f186-4142-be8a-a62462794fdc), [Array.iteri](http://msdn.microsoft.com/en-us/library/8bbe2ed4-ada7-4906-ac3e-cb09f9db6486), and Array.iteri2.** [!code-fsharp[Main](snippets/fsarrays/snippet49.fs)] **Output** -**Array.iter: element is 1** -**Array.iter: element is 2** -**Array.iter: element is 3** -**Array.iteri: element 0 is 1** -**Array.iteri: element 1 is 2** -**Array.iteri: element 2 is 3** -**Array.iter2: elements are 1 4** -**Array.iter2: elements are 2 5** -**Array.iter2: elements are 3 6** -**Array.iteri2: element 0 of array1 is 1 element 0 of array2 is 4** -**Array.iteri2: element 1 of array1 is 2 element 1 of array2 is 5** -**Array.iteri2: element 2 of array1 is 3 element 2 of array2 is 6** +``` +Array.iter: element is 1 +Array.iter: element is 2 +Array.iter: element is 3 +Array.iteri: element 0 is 1 +Array.iteri: element 1 is 2 +Array.iteri: element 2 is 3 +Array.iter2: elements are 1 4 +Array.iter2: elements are 2 5 +Array.iter2: elements are 3 6 +Array.iteri2: element 0 of array1 is 1 element 0 of array2 is 4 +Array.iteri2: element 1 of array1 is 2 element 1 of array2 is 5 +Array.iteri2: element 2 of array1 is 3 element 2 of array2 is 6 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.length['t]-function-[fsharp].md b/docs/conceptual/array.length['t]-function-[fsharp].md index 1a2a8a25..65c620b9 100644 --- a/docs/conceptual/array.length['t]-function-[fsharp].md +++ b/docs/conceptual/array.length['t]-function-[fsharp].md @@ -18,63 +18,54 @@ Returns the length of an array. **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.length : 'T [] -> int // Usage: Array.length array - - ``` - - - - #### Parameters + *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the length of the array.** - -**The length of the array.** ## Remarks -You can also use property **P:System.Array.Length**. + +You can also use the property **System.Array.Length**. This function is named **Length** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code example demonstrates how to use Array.length.** [!code-fsharp[Main](snippets/fsarrays/snippet50.fs)] + **Output** -**Length: 100** -**Length: 0** -**Length: 50** + +``` +Length: 100 +Length: 0 +Length: 50 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.map2['t1,'t2,'u]-function-[fsharp].md b/docs/conceptual/array.map2['t1,'t2,'u]-function-[fsharp].md index 4e5c9a89..75db82a1 100644 --- a/docs/conceptual/array.map2['t1,'t2,'u]-function-[fsharp].md +++ b/docs/conceptual/array.map2['t1,'t2,'u]-function-[fsharp].md @@ -12,60 +12,39 @@ ms.assetid: fb4d9619-58bb-4073-b5b4-9bc315ca035d # Array.map2<'T1,'T2,'U> Function (F#) -Builds a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise. The two input arrays must have the same lengths, otherwise **T:System.ArgumentException** is raised. +Builds a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise. The two input arrays must have the same lengths, otherwise **System.ArgumentException** is raised. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.map2 : ('T1 -> 'T2 -> 'U) -> 'T1 [] -> 'T2 [] -> 'U [] // Usage: Array.map2 mapping array1 array2 - - ``` - - - - #### Parameters *mapping* Type: **'T1 -> 'T2 -> 'U** - The function to transform the pairs of the input elements. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - - -**exceptions tag is not supported!!!!** -**The array of transformed elements.** +**Returns the array of transformed elements.** ## Remarks This function is named **Map2** in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. @@ -76,15 +55,11 @@ This function is named **Map2** in compiled assemblies. If you are accessing the ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.mapi2['t1,'t2,'u]-function-[fsharp].md b/docs/conceptual/array.mapi2['t1,'t2,'u]-function-[fsharp].md index 5c9bc84c..d50c048d 100644 --- a/docs/conceptual/array.mapi2['t1,'t2,'u]-function-[fsharp].md +++ b/docs/conceptual/array.mapi2['t1,'t2,'u]-function-[fsharp].md @@ -12,60 +12,40 @@ ms.assetid: ec0d66da-62bf-4598-b20e-845c8197c78e # Array.mapi2<'T1,'T2,'U> Function (F#) -Builds a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise, also passing the index of the elements. The two input arrays must have the same lengths, otherwise **T:System.ArgumentException** is raised. +Builds a new collection whose elements are the results of applying the given function to the corresponding elements of the two collections pairwise, also passing the index of the elements. The two input arrays must have the same lengths, otherwise **System.ArgumentException** is raised. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.mapi2 : (int -> 'T1 -> 'T2 -> 'U) -> 'T1 [] -> 'T2 [] -> 'U [] // Usage: Array.mapi2 mapping array1 array2 - - ``` - - - - #### Parameters *mapping* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**-> 'T1 -> 'T2 -> 'U** - The function to transform pairs of input elements and their indices. - *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. +**Returns the array of transformed elements.** - -**exceptions tag is not supported!!!!** -**The array of transformed elements.** ## 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. @@ -76,15 +56,11 @@ This function is named **MapIndexed2** in compiled assemblies. If you are access ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.max['t]-function-[fsharp].md b/docs/conceptual/array.max['t]-function-[fsharp].md index 59d20714..9f14e4e2 100644 --- a/docs/conceptual/array.max['t]-function-[fsharp].md +++ b/docs/conceptual/array.max['t]-function-[fsharp].md @@ -18,60 +18,51 @@ Returns the greatest of all elements of the array, compared by using [Operators. **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.max : 'T [] -> 'T (requires comparison) // Usage: Array.max array - - ``` - - - - #### Parameters + *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the maximum element.** - -**exceptions tag is not supported!!!!** -**The maximum element.** ## Remarks + This function is named **Max** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code example demonstrates how to use Array.max.** + [!code-fsharp[Main](snippets/fsarrays/snippet55.fs)] + **Output** -**4** + +``` +4 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md b/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md index bc689903..7473ed28 100644 --- a/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md +++ b/docs/conceptual/array.maxby['t,'u]-function-[fsharp].md @@ -18,68 +18,56 @@ Returns the greatest of all elements of the array, compared by using [Operators. **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.maxBy : ('T -> 'U) -> 'T [] -> 'T (requires comparison) // Usage: Array.maxBy projection array - - ``` - - - - #### Parameters + *projection* Type: **'T -> 'U** - The function to transform the elements into a type supporting comparison. - *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the maximum element.** - -**exceptions tag is not supported!!!!** -**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. **The following code example demonstrates the use of Array.maxBy.** + [!code-fsharp[Main](snippets/fsarrays/snippet56.fs)] + **Output** -**0.0** + +``` +0.0 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array.min['t]-function-[fsharp].md b/docs/conceptual/array.min['t]-function-[fsharp].md index cddabca0..135a4362 100644 --- a/docs/conceptual/array.min['t]-function-[fsharp].md +++ b/docs/conceptual/array.min['t]-function-[fsharp].md @@ -18,61 +18,51 @@ Returns the lowest of all elements of the array, compared by using [Operators.mi **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.min : 'T [] -> 'T (requires comparison) // Usage: Array.min array - - ``` - - - - #### Parameters + *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the minimum element.** - -**exceptions tag is not supported!!!!** -**The minimum element.** ## Remarks + This function is named **Min** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code demonstrates the use of Array.min.** + [!code-fsharp[Main](snippets/fsarrays/snippet57.fs)] + **Output** -**-4** + +``` +-4 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array.minby['t,'u]-function-[fsharp].md b/docs/conceptual/array.minby['t,'u]-function-[fsharp].md index 57918028..69d1d862 100644 --- a/docs/conceptual/array.minby['t,'u]-function-[fsharp].md +++ b/docs/conceptual/array.minby['t,'u]-function-[fsharp].md @@ -18,68 +18,55 @@ Returns the lowest of all elements of the array, compared by using [Operators.mi **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.minBy : ('T -> 'U) -> 'T [] -> 'T (requires comparison) // Usage: Array.minBy projection array - - ``` - - - - - #### Parameters + *projection* Type: **'T -> 'U** - The function to transform the elements into a type supporting comparison. - *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the minimum element.** - -**exceptions tag is not supported!!!!** -**The minimum element.** ## Remarks + This function is named **MinBy** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code example demonstrates the use of Array.minBy.** + [!code-fsharp[Main](snippets/fsarrays/snippet58.fs)] + **Output** -**0.0** + +``` +0.0 +``` + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array.pick['t,'u]-function-[fsharp].md b/docs/conceptual/array.pick['t,'u]-function-[fsharp].md index c043e9ef..75cce4e8 100644 --- a/docs/conceptual/array.pick['t,'u]-function-[fsharp].md +++ b/docs/conceptual/array.pick['t,'u]-function-[fsharp].md @@ -12,60 +12,47 @@ ms.assetid: 5366de7d-33b4-4bc4-9c9f-870cf85c4700 # Array.pick<'T,'U> Function (F#) -Applies the given function to successive elements, returning the first result where function returns **Some**. If the function never returns **Some** then **T:System.Collections.Generic.KeyNotFoundException** is raised. +Applies the given function to successive elements, returning the first result where function returns **Some**. If the function never returns **Some** then **System.Collections.Generic.KeyNotFoundException** is raised. **Namespace/Module Path**: Microsoft.FSharp.Collections.Array **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.pick : ('T -> 'U option) -> 'T [] -> 'U // Usage: Array.pick chooser array - - ``` - - - - #### Parameters *chooser* -Type: **'T -> 'U**[option](http://msdn.microsoft.com/en-us/library/b08add48-34bf-4410-80a1-ef6a8daddc58) - +Type: **'T -> 'U [option](http://msdn.microsoft.com/en-us/library/b08add48-34bf-4410-80a1-ef6a8daddc58)** The function to generate options from the elements. - *array* -Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - +Type: **'T [[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493)** The input array. +**Returns the first result.** - -**exceptions tag is not supported!!!!** -**The first result.** ## Remarks This function is named **Pick** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following code example shows how to use Array.pick.** [!code-fsharp[Main](snippets/fsarrays/snippet62.fs)] + **Output** -**"b"** + +``` +"b" +``` + ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 @@ -76,8 +63,6 @@ Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 Supported in: 2.0, 4.0, Portable - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.reduce['t]-function-[fsharp].md b/docs/conceptual/array.reduce['t]-function-[fsharp].md index b423ff66..d8557620 100644 --- a/docs/conceptual/array.reduce['t]-function-[fsharp].md +++ b/docs/conceptual/array.reduce['t]-function-[fsharp].md @@ -12,71 +12,55 @@ ms.assetid: 3be190a5-251c-4286-bd19-c6af6c5171e4 # Array.reduce<'T> Function (F#) -Applies a function to each element of the array, threading an accumulator argument through the computation. If the input function is **f** and the elements are **i0...iN**, then computes **f (... (f i0 i1)...) iN**. Raises **T:System.ArgumentException** if the array has size zero. +Applies a function to each element of the array, threading an accumulator argument through the computation. If the input function is **f** and the elements are **i0...iN**, then computes **f (... (f i0 i1)...) iN**. Raises **System.ArgumentException** if the array has size zero. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.reduce : ('T -> 'T -> 'T) -> 'T [] -> 'T // Usage: Array.reduce reduction array - - ``` - - - - #### Parameters *reduction* Type: **'T -> 'T -> 'T** - The function to reduce a pair of elements to a single element. - *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the final result of the reductions.** - -**exceptions tag is not supported!!!!** -**The final result of the reductions.** ## Remarks This function is named **Reduce** in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name. **The following example demonstrates the use of Array.reduce.** [!code-fsharp[Main](snippets/fssamples101/snippet1006.fs)] -**sentence = A man landed on the moon** + +**Output** + +``` +sentence = A man landed on the moon +``` + ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.reduceback['t]-function-[fsharp].md b/docs/conceptual/array.reduceback['t]-function-[fsharp].md index 28bebfa3..69928234 100644 --- a/docs/conceptual/array.reduceback['t]-function-[fsharp].md +++ b/docs/conceptual/array.reduceback['t]-function-[fsharp].md @@ -12,73 +12,56 @@ ms.assetid: 928a0256-d038-45a3-a4aa-bf3c5bc337df # Array.reduceBack<'T> Function (F#) -Applies a function to each element of the array, threading an accumulator argument through the computation. If the input function is **f** and the elements are **i0...iN** then computes **f i0 (...(f iN-1 iN))**. Raises **T:System.ArgumentException** if the array has size zero. +Applies a function to each element of the array, threading an accumulator argument through the computation. If the input function is **f** and the elements are **i0...iN** then computes **f i0 (...(f iN-1 iN))**. Raises **System.ArgumentException** if the array has size zero. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.reduceBack : ('T -> 'T -> 'T) -> 'T [] -> 'T // Usage: Array.reduceBack reduction array - - ``` - - - - #### Parameters *reduction* Type: **'T -> 'T -> 'T** - The function to reduce a pair of elements to a single element. - *array* Type: **'T**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The input array. +**Returns the final result of the reductions.** - -**exceptions tag is not supported!!!!** -**The final result of the reductions.** ## Remarks This function is named **ReduceBack** in compiled assemblies. If you are accessing the member from a language other than F#, or through reflection, use this name. **The following code example compares [Array.reduce](http://msdn.microsoft.com/en-us/library/fd62a985-89fe-4f49-a9d4-0c808ac6749d) and Array.reduceBack.** [!code-fsharp[Main](snippets/fsarrays/snippet63.fs)] + **Output** -**-8** -**-2** + +``` +-8 +-2 +``` + ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.zip3['t1,'t2,'t3]-function-[fsharp].md b/docs/conceptual/array.zip3['t1,'t2,'t3]-function-[fsharp].md index f791cb61..21f43136 100644 --- a/docs/conceptual/array.zip3['t1,'t2,'t3]-function-[fsharp].md +++ b/docs/conceptual/array.zip3['t1,'t2,'t3]-function-[fsharp].md @@ -12,7 +12,7 @@ ms.assetid: a8d77585-9382-4fa8-9839-0cb53d478704 # Array.zip3<'T1,'T2,'T3> Function (F#) -Combines three arrays into an array of tuples with three elements. The three arrays must have equal lengths, otherwise an **T:System.ArgumentException** is raised. +Combines three arrays into an array of tuples with three elements. The three arrays must have equal lengths, otherwise an **System.ArgumentException** is raised. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array @@ -21,70 +21,51 @@ Combines three arrays into an array of tuples with three elements. The three arr ## Syntax - - ``` - - - - // Signature: Array.zip3 : 'T1 [] -> 'T2 [] -> 'T3 [] -> ('T1 * 'T2 * 'T3) [] // Usage: Array.zip3 array1 array2 array3 - - ``` - - - - #### Parameters *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. - *array3* Type: **'T3**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The third input array. +**Returns the array of tupled elements.** - -**exceptions tag is not supported!!!!** -**The array of tupled elements.** ## 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. **The following code shows how to use Array.zip3.** [!code-fsharp[Main](snippets/fsarrays/snippet73.fs)] + **Output** -**[|(1, -1, "horse"); (2, -2, "dog"); (3, -3, "elephant")|]** + +``` +[|(1, -1, "horse"); (2, -2, "dog"); (3, -3, "elephant")|] +``` ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array.zip['t1,'t2]-function-[fsharp].md b/docs/conceptual/array.zip['t1,'t2]-function-[fsharp].md index 31048575..8c7e8443 100644 --- a/docs/conceptual/array.zip['t1,'t2]-function-[fsharp].md +++ b/docs/conceptual/array.zip['t1,'t2]-function-[fsharp].md @@ -12,72 +12,55 @@ ms.assetid: 0463857c-1ba9-4f07-9094-3bd26758bd2e # Array.zip<'T1,'T2> Function (F#) -Combines the two arrays into an array of tuples with two elements. The two arrays must have equal lengths, otherwise **T:System.ArgumentException** is raised. +Combines the two arrays into an array of tuples with two elements. The two arrays must have equal lengths, otherwise **System.ArgumentException** is raised. **Namespace/Module Path:** Microsoft.FSharp.Collections.Array **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array.zip : 'T1 [] -> 'T2 [] -> ('T1 * 'T2) [] // Usage: Array.zip array1 array2 - - ``` - - - - #### Parameters *array1* Type: **'T1**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The first input array. - *array2* Type: **'T2**[[]](http://msdn.microsoft.com/en-us/library/def20292-9aae-4596-9275-b94e594f8493) - The second input array. +**Returns the array of tupled elements.** - -**exceptions tag is not supported!!!!** -**The array of tupled elements.** ## 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. **The following code shows how to use Array.zip.** [!code-fsharp[Main](snippets/fsarrays/snippet72.fs)] + **Output** -**[|(1, -1); (2, -2); (3, -3)|]** + +``` +[|(1, -1); (2, -2); (3, -3)|] +``` + ## Platforms Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 - ## Version Information **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md) diff --git a/docs/conceptual/array2d.blit['t]-function-[fsharp].md b/docs/conceptual/array2d.blit['t]-function-[fsharp].md index 5242d482..e88014af 100644 --- a/docs/conceptual/array2d.blit['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.blit['t]-function-[fsharp].md @@ -18,107 +18,74 @@ Reads a range of elements from the first array and writes them into the second. **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.blit : 'T [,] -> int -> int -> 'T [,] -> int -> int -> int -> int -> unit // Usage: Array2D.blit source sourceIndex1 sourceIndex2 target targetIndex1 targetIndex2 length1 length2 - - ``` - - - - #### Parameters + *source* Type: **'T**[[,]](http://msdn.microsoft.com/en-us/library/077252f3-e6ce-441c-9d5b-a6030eaef7cd) - The source array. - *sourceIndex1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The first-dimension index to begin copying from in the source array. - *sourceIndex2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The second-dimension index to begin copying from in the source array. - *target* Type: **'T**[[,]](http://msdn.microsoft.com/en-us/library/077252f3-e6ce-441c-9d5b-a6030eaef7cd) - The target array. - *targetIndex1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The first-dimension index to begin copying into in the target array. - *targetIndex2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The second-dimension index to begin copying into in the target array. - *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The number of elements to copy across the first dimension of the arrays. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The number of elements to copy across the second dimension of the arrays. - - -**exceptions tag is not supported!!!!** - ## Remarks -This function is named **CopyTo** 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 **CopyTo** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.create['t]-function-[fsharp].md b/docs/conceptual/array2d.create['t]-function-[fsharp].md index 99f7f85a..c20758aa 100644 --- a/docs/conceptual/array2d.create['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.create['t]-function-[fsharp].md @@ -18,72 +18,51 @@ Creates an array whose elements are all initially the given value. **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.create : int -> int -> 'T -> 'T [,] // Usage: Array2D.create length1 length2 value - - ``` - - - - #### Parameters + *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. - *value* Type: **'T** - The value to populate the new array. +**Returns the created array.** - -**exceptions tag is not supported!!!!** -**The created array.** ## Remarks -This function is named **Create** 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 **Create** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.createbased['t]-function-[fsharp].md b/docs/conceptual/array2d.createbased['t]-function-[fsharp].md index 1c006876..0ba3e317 100644 --- a/docs/conceptual/array2d.createbased['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.createbased['t]-function-[fsharp].md @@ -18,84 +18,61 @@ Creates a based array whose elements are all initially the given value. **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.createBased : int -> int -> int -> int -> 'T -> 'T [,] // Usage: Array2D.createBased base1 base2 length1 length2 initial - - ``` - - - - #### Parameters + *base1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the first dimension of the array. - *base2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the second dimension of the array. - *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. - *initial* Type: **'T** - The value to populate the new array. +**Returns the created array.** - -**exceptions tag is not supported!!!!** -**The created array.** ## Remarks -This function is named **CreateBased** 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 **CreateBased** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0 - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.get['t]-function-[fsharp].md b/docs/conceptual/array2d.get['t]-function-[fsharp].md index d0cf14e3..a6684885 100644 --- a/docs/conceptual/array2d.get['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.get['t]-function-[fsharp].md @@ -18,72 +18,51 @@ Fetches an element from a 2D array. You can also use the syntax **array.[index1, **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.get : 'T [,] -> int -> int -> 'T // Usage: Array2D.get array index1 index2 - - ``` - - - - #### Parameters + *array* Type: **'T**[[,]](http://msdn.microsoft.com/en-us/library/077252f3-e6ce-441c-9d5b-a6030eaef7cd) - The input array. - *index1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The index along the first dimension. - *index2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The index along the second dimension. +**Returns the value of the array at the given index.** - -**exceptions tag is not supported!!!!** -**The value of the array at the given index.** ## Remarks -This function is named **Get** in compiled assemblies. If you are accessing the member from a language other than F#, or through reflection, use this name. +This function is named **Get** in compiled assemblies. If you are accessing the member 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [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 15545b85..4943288c 100644 --- a/docs/conceptual/array2d.init['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.init['t]-function-[fsharp].md @@ -18,73 +18,55 @@ Creates an array given the dimensions and a generator function to compute the el **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.init : int -> int -> (int -> int -> 'T) -> 'T [,] // Usage: Array2D.init length1 length2 initializer - - ``` - - - - #### Parameters + *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. - *initializer* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**->**[int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**-> 'T** - A function to produce elements of the array given the two indices. +**Returns the generated array.** - -**exceptions tag is not supported!!!!** -**The generated array.** ## Remarks + 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. **The following code demonstrates the use of Array2D.init to create a two-dimensional array.** + [!code-fsharp[Main](snippets/fsarrays/snippet21.fs)] + ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.initbased['t]-function-[fsharp].md b/docs/conceptual/array2d.initbased['t]-function-[fsharp].md index f7264003..660784e3 100644 --- a/docs/conceptual/array2d.initbased['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.initbased['t]-function-[fsharp].md @@ -18,84 +18,61 @@ Creates a based array given the dimensions and a generator function to compute t **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.initBased : int -> int -> int -> int -> (int -> int -> 'T) -> 'T [,] // Usage: Array2D.initBased base1 base2 length1 length2 initializer - - ``` - - - - #### Parameters + *base1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the first dimension of the array. - *base2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the second dimension of the array. - *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. - *initializer* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**->**[int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375)**-> 'T** - A function to produce elements of the array given the two indices. +**Returns the created array.** - -**exceptions tag is not supported!!!!** -**The created array.** ## Remarks -This function is named **InitializeBased** 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 **InitializeBased** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0 - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.set['t]-function-[fsharp].md b/docs/conceptual/array2d.set['t]-function-[fsharp].md index 2be0da47..c9c11364 100644 --- a/docs/conceptual/array2d.set['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.set['t]-function-[fsharp].md @@ -18,81 +18,56 @@ Sets the value of an element in an array. **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.set : 'T [,] -> int -> int -> 'T -> unit // Usage: Array2D.set array index1 index2 value - - ``` - - - - #### Parameters + *array* Type: **'T**[[,]](http://msdn.microsoft.com/en-us/library/077252f3-e6ce-441c-9d5b-a6030eaef7cd) - The input array. - *index1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The index along the first dimension. - *index2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The index along the second dimension. - *value* Type: **'T** - The value to set in the array. - - -**exceptions tag is not supported!!!!** - ## Remarks + You can also use the syntax **array.[index1,index2] <- value**. This function is named **Set** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.zerocreate['t]-function-[fsharp].md b/docs/conceptual/array2d.zerocreate['t]-function-[fsharp].md index f247c1fb..37ea0bf7 100644 --- a/docs/conceptual/array2d.zerocreate['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.zerocreate['t]-function-[fsharp].md @@ -18,65 +18,47 @@ Creates an array where the entries are initially [Unchecked.defaultof<'T>] **Assembly**: FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.zeroCreate : int -> int -> 'T [,] // Usage: Array2D.zeroCreate length1 length2 - - ``` - - - - #### Parameters + *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. +**Returns the created array.** -**exceptions tag is not supported!!!!** -**The created array.** ## Remarks -This function is named **ZeroCreate** 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 **ZeroCreate** 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 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0, Portable - - - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/array2d.zerocreatebased['t]-function-[fsharp].md b/docs/conceptual/array2d.zerocreatebased['t]-function-[fsharp].md index eeefc57e..dd491b54 100644 --- a/docs/conceptual/array2d.zerocreatebased['t]-function-[fsharp].md +++ b/docs/conceptual/array2d.zerocreatebased['t]-function-[fsharp].md @@ -18,77 +18,56 @@ Creates a based array where the entries are initially [Unchecked.defaultof<'T **Assembly:** FSharp.Core (in FSharp.Core.dll) - ## Syntax - - ``` - - - - // Signature: Array2D.zeroCreateBased : int -> int -> int -> int -> 'T [,] // Usage: Array2D.zeroCreateBased base1 base2 length1 length2 - - ``` - - - - #### Parameters + *base1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the first dimension of the array. - *base2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The base for the second dimension of the array. - *length1* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the first dimension of the array. - *length2* Type: [int](http://msdn.microsoft.com/en-us/library/025d5455-3622-4ea5-9573-3ecbd4ee1375) - The length of the second dimension of the array. +**Returns the created array.** - -**exceptions tag is not supported!!!!** -**The created array.** ## Remarks -This function is named **ZeroCreateBased** in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. +This function is named **ZeroCreateBased** in compiled assemblies. If you are accessing the function from a .NET language other than F#, or through reflection, use this name. ## Platforms -Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 +Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2 ## Version Information + **F# Core Library Versions** Supported in: 2.0, 4.0 - ## See Also + [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md) [Microsoft.FSharp.Collections Namespace (F#)](Microsoft.FSharp.Collections-Namespace-%5BFSharp%5D.md) - diff --git a/docs/conceptual/arrays-[fsharp].md b/docs/conceptual/arrays-[fsharp].md index 6eeb2415..c30488bd 100644 --- a/docs/conceptual/arrays-[fsharp].md +++ b/docs/conceptual/arrays-[fsharp].md @@ -14,328 +14,195 @@ ms.assetid: 61fa9084-abdc-4cf5-8213-91ec1211866b Arrays are fixed-size, zero-based, mutable collections of consecutive data elements that are all of the same type. - ## Creating Arrays You can create arrays in several ways. You can create a small array by listing consecutive values between [| and |] and separated by semicolons, as shown in the following examples. [!code-fsharp[Main](snippets/fsarrays/snippet1.fs)] - You can also put each element on a separate line, in which case the semicolon separator is optional. - -[!code-fsharp[Main](snippets/fsarrays/snippet2.fs)] - The type of the array elements is inferred from the literals used and must be consistent. The following code causes an error because 1.0 is a float and 2 and 3 are integers. +You can also put each element on a separate line, in which case the semicolon separator is optional. +[!code-fsharp[Main](snippets/fsarrays/snippet2.fs)] +The type of the array elements is inferred from the literals used and must be consistent. The following code causes an error because 1.0 is a float and 2 and 3 are integers. ``` - - - -f# // Causes an error. // let array2 = [| 1.0; 2; 3 |] - ``` - - - You can also use sequence expressions to create arrays. Following is an example that creates an array of squares of integers from 1 to 10. [!code-fsharp[Main](snippets/fsarrays/snippet3.fs)] - To create an array in which all the elements are initialized to zero, use **Array.zeroCreate**. + +To create an array in which all the elements are initialized to zero, use **Array.zeroCreate**. [!code-fsharp[Main](snippets/fsarrays/snippet4.fs)] ## Accessing Elements + You can access array elements by using a dot operator (.) and brackets ([ and ]). [!code-fsharp[Main](snippets/fsarrays/snippet5.fs)] - Array indices start at 0. + +Array indices start at 0. You can also access array elements by using slice notation, which enables you to specify a subrange of the array. Examples of slice notation follow. [!code-fsharp[Main](snippets/fsarrays/snippet51.fs)] - When slice notation is used, a new copy of the array is created. +When slice notation is used, a new copy of the array is created. -## Array Types and Modules -The type of all F# arrays is the .NET Framework type **T:System.Array**. Therefore, F# arrays support all the functionality available in **T:System.Array**. -The library module [Microsoft.FSharp.Collections.Array](http://msdn.microsoft.com/en-us/library/0cda8040-9396-40dd-8dcd-cf48542165a1) supports operations on one-dimensional arrays. The modules **Array2D**, **Array3D**, and **Array4D** contain functions that support operations on arrays of two, three, and four dimensions, respectively. You can create arrays of rank greater than four by using **T:System.Array**. +## Array Types and Modules +The type of all F# arrays is the .NET Framework type **System.Array**. Therefore, F# arrays support all the functionality available in **System.Array**. +The library module [Microsoft.FSharp.Collections.Array](http://msdn.microsoft.com/en-us/library/0cda8040-9396-40dd-8dcd-cf48542165a1) supports operations on one-dimensional arrays. The modules **Array2D**, **Array3D**, and **Array4D** contain functions that support operations on arrays of two, three, and four dimensions, respectively. You can create arrays of rank greater than four by using **System.Array**. ### Simple Functions [Array.get](http://msdn.microsoft.com/en-us/library/dd93e85d-7e80-4d76-8de0-b6d45bcf07bc) gets an element. [Array.length](http://msdn.microsoft.com/en-us/library/0d775b6a-4a8f-4bd1-83e5-843b3251725f) gives the length of an array. [Array.set](http://msdn.microsoft.com/en-us/library/847edc0d-4dc5-4a39-98c7-d4320c60e790) sets an element to a specified value. The following code example illustrates the use of these functions. [!code-fsharp[Main](snippets/fsarrays/snippet9.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - 0 1 2 3 4 5 6 7 8 9 - - ``` - - - - ### Functions That Create Arrays + Several functions create arrays without requiring an existing array. [Array.empty](http://msdn.microsoft.com/en-us/library/c3694b92-1c16-4c54-9bf2-fe398fadce32) creates a new array that does not contain any elements. [Array.create](http://msdn.microsoft.com/en-us/library/e848c8d6-1142-4080-9727-8dacc26066be) creates an array of a specified size and sets all the elements to provided values. [Array.init](http://msdn.microsoft.com/en-us/library/ee898089-63b0-40aa-910c-5ae7e32f6665) creates an array, given a dimension and a function to generate the elements. [Array.zeroCreate](http://msdn.microsoft.com/en-us/library/fa5b8e7a-1b5b-411c-8622-b58d7a14d3b2) creates an array in which all the elements are initialized to the zero value for the array's type. The following code demonstrates these functions. [!code-fsharp[Main](snippets/fsarrays/snippet91.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - Length of empty array: 0 Area of floats set to 5.0: [|5.0; 5.0; 5.0; 5.0; 5.0; 5.0; 5.0; 5.0; 5.0; 5.0|] Array of squares: [|0; 1; 4; 9; 16; 25; 36; 49; 64; 81|] - - ``` - - - [Array.copy](http://msdn.microsoft.com/en-us/library/9d0202f1-1ea0-475e-9d66-4f8ccc3c5b5f) creates a new array that contains elements that are copied from an existing array. Note that the copy is a shallow copy, which means that if the element type is a reference type, only the reference is copied, not the underlying object. The following code example illustrates this. [!code-fsharp[Main](snippets/fsarrays/snippet11.fs)] - The output of the preceding code is as follows: - - +The output of the preceding code is as follows: ``` - - - - [|Test1; Test2; |] [|; Test2; |] - - ``` - - - -The string **Test1** appears only in the first array because the operation of creating a new element overwrites the reference in **firstArray** but does not affect the original reference to an empty string that is still present in **secondArray**. The string **Test2** appears in both arrays because the **Insert** operation on the **T:System.Text.StringBuilder** type affects the underlying **T:System.Text.StringBuilder** object, which is referenced in both arrays. +The string **Test1** appears only in the first array because the operation of creating a new element overwrites the reference in **firstArray** but does not affect the original reference to an empty string that is still present in **secondArray**. The string **Test2** appears in both arrays because the **Insert** operation on the **System.Text.StringBuilder** type affects the underlying **System.Text.StringBuilder** object, which is referenced in both arrays. [Array.sub](http://msdn.microsoft.com/en-us/library/40fb12ba-41d7-4ef0-b33a-56727deeef9d) generates a new array from a subrange of an array. You specify the subrange by providing the starting index and the length. The following code demonstrates the use of **Array.sub**. [!code-fsharp[Main](snippets/fsarrays/snippet12.fs)] - The output shows that the subarray starts at element 5 and contains 10 elements. - - +The output shows that the subarray starts at element 5 and contains 10 elements. ``` - - - - [|5; 6; 7; 8; 9; 10; 11; 12; 13; 14|] - - ``` - - - - [Array.append](http://msdn.microsoft.com/en-us/library/08836310-5036-4474-b9a2-2c73e2293911) creates a new array by combining two existing arrays. The following code demonstrates **Array.append**. [!code-fsharp[Main](snippets/fsarrays/snippet13.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - [|1; 2; 3; 4; 5; 6|] - - ``` - - - [Array.choose](http://msdn.microsoft.com/en-us/library/f5c8a5e2-637f-44d4-b35c-be96a6618b09) selects elements of an array to include in a new array. The following code demonstrates **Array.choose**. Note that the element type of the array does not have to match the type of the value returned in the option type. In this example, the element type is **int** and the option is the result of a polynomial function, **elem*elem - 1**, as a floating point number. [!code-fsharp[Main](snippets/fsarrays/snippet14.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - [|3.0; 15.0; 35.0; 63.0; 99.0|] - - ``` - - - [Array.collect](http://msdn.microsoft.com/en-us/library/c3b60c3b-9455-48c9-bc2b-e88f0434342a) runs a specified function on each array element of an existing array and then collects the elements generated by the function and combines them into a new array. The following code demonstrates **Array.collect**. [!code-fsharp[Main](snippets/fsarrays/snippet15.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - [|0; 1; 0; 1; 2; 3; 4; 5; 0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10|] - - ``` - - - [Array.concat](http://msdn.microsoft.com/en-us/library/f7219b79-1ec8-4a25-96b1-edbedb358302) takes a sequence of arrays and combines them into a single array. The following code demonstrates **Array.concat**. [!code-fsharp[Main](snippets/fsarrays/snippet16.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - [|(1, 1, 1); (1, 2, 2); (1, 3, 3); (2, 1, 2); (2, 2, 4); (2, 3, 6); (3, 1, 3); (3, 2, 6); (3, 3, 9)|] - - ``` - - - [Array.filter](http://msdn.microsoft.com/en-us/library/b885b214-47fc-4639-9664-b8c183a39ede) takes a Boolean condition function and generates a new array that contains only those elements from the input array for which the condition is true. The following code demonstrates **Array.filter**. [!code-fsharp[Main](snippets/fsarrays/snippet17.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - [|2; 4; 6; 8; 10|] - - ``` - - - [Array.rev](http://msdn.microsoft.com/en-us/library/1bbf822c-763b-4794-af21-97d2e48ef709) generates a new array by reversing the order of an existing array. The following code demonstrates **Array.rev**. -[!code-fsharp[Main](snippets/fsarrays/snippet18.fs)] - The output of the preceding code is as follows. - - +[!code-fsharp[Main](snippets/fsarrays/snippet18.fs)] +The output of the preceding code is as follows. ``` - - - - "Hello world!" - - ``` - - - You can easily combine functions in the array module that transform arrays by using the pipeline operator (|>), as shown in the following example. [!code-fsharp[Main](snippets/fsarrays/snippet19.fs)] - The output is - - +The output is ``` - - - - [|100; 36; 16; 4|] - - ``` - - - - ### Multidimensional Arrays + A multidimensional array can be created, but there is no syntax for writing a multidimensional array literal. Use the operator [array2D](http://msdn.microsoft.com/en-us/library/1d52503d-2990-49fc-8fd3-6b0e508aa236) to create an array from a sequence of sequences of array elements. The sequences can be array or list literals. For example, the following code creates a two-dimensional array. [!code-fsharp[Main](snippets/fsarrays/snippet20.fs)] - You can also use the function [Array2D.init](http://msdn.microsoft.com/en-us/library/9de07e95-bc21-4927-b5b4-08fdec882c7b) to initialize arrays of two dimensions, and similar functions are available for arrays of three and four dimensions. These functions take a function that is used to create the elements. To create a two-dimensional array that contains elements set to an initial value instead of specifying a function, use the [Array2D.create](http://msdn.microsoft.com/en-us/library/36c9d980-b241-4a20-bc64-bcfa0205d804) function, which is also available for arrays up to four dimensions. The following code example first shows how to create an array of arrays that contain the desired elements, and then uses **Array2D.init** to generate the desired two-dimensional array. + +You can also use the function [Array2D.init](http://msdn.microsoft.com/en-us/library/9de07e95-bc21-4927-b5b4-08fdec882c7b) to initialize arrays of two dimensions, and similar functions are available for arrays of three and four dimensions. These functions take a function that is used to create the elements. To create a two-dimensional array that contains elements set to an initial value instead of specifying a function, use the [Array2D.create](http://msdn.microsoft.com/en-us/library/36c9d980-b241-4a20-bc64-bcfa0205d804) function, which is also available for arrays up to four dimensions. The following code example first shows how to create an array of arrays that contain the desired elements, and then uses **Array2D.init** to generate the desired two-dimensional array. [!code-fsharp[Main](snippets/fsarrays/snippet21.fs)] - Array indexing and slicing syntax is supported for arrays up to rank 4. When you specify an index in multiple dimensions, you use commas to separate the indices, as illustrated in the following code example. + +Array indexing and slicing syntax is supported for arrays up to rank 4. When you specify an index in multiple dimensions, you use commas to separate the indices, as illustrated in the following code example. [!code-fsharp[Main](snippets/fsarrays/snippet22.fs)] - The type of a two-dimensional array is written out as **<type>[,]** (for example, **int[,]**, **double[,]**), and the type of a three-dimensional array is written as **<type>[,,]**, and so on for arrays of higher dimensions. + +The type of a two-dimensional array is written out as **<type>[,]** (for example, **int[,]**, **double[,]**), and the type of a three-dimensional array is written as **<type>[,,]**, and so on for arrays of higher dimensions. Only a subset of the functions available for one-dimensional arrays is also available for multidimensional arrays. For more information, see [Collections.Array Module (F#)](Collections.Array-Module-%5BFSharp%5D.md), [Collections.Array2D Module (F#)](Collections.Array2D-Module-%5BFSharp%5D.md), [Collections.Array3D Module (F#)](Collections.Array3D-Module-%5BFSharp%5D.md), and [Collections.Array4D Module (F#)](Collections.Array4D-Module-%5BFSharp%5D.md). - ### Array Slicing and Multidimensional Arrays -In a two-dimensional array (a matrix), you can extract a sub-matrix by specifying ranges and using a wildcard (*) character to specify whole rows or columns. - - - - -``` - +In a two-dimensional array (a matrix), you can extract a sub-matrix by specifying ranges and using a wildcard (*) character to specify whole rows or columns. -f# -// Get rows 1 to N from an NxM matrix (returns a matrix): +```fsharp +/ Get rows 1 to N from an NxM matrix (returns a matrix): matrix.[1.., *] // Get rows 1 to 3 from a matrix (returns a matrix): @@ -346,45 +213,21 @@ matrix.[*, 1..3] // Get a 3x3 submatrix: matrix.[1..3, 1..3] - - ``` - - - As of F# 3.1, you can decompose a multidimensional array into subarrays of the same or lower dimension. For example, you can obtain a vector from a matrix by specifying a single row or column. - - - -``` - - - -f# +```fsharp // Get row 3 from a matrix as a vector: matrix.[3, *] // Get column 3 from a matrix as a vector: matrix.[*, 3] - - ``` - - - You can use this slicing syntax for types that implement the element access operators and overloaded **GetSlice** methods. For example, the following code creates a Matrix type that wraps the F# 2D array, implements an Item property to provide support for array indexing, and implements three versions of **GetSlice**. If you can use this code as a template for your matrix types, you can use all the slicing operations that this section describes. - - - -``` - - - -f# +```fsharp type Matrix<'T>(N: int, M: int) = let internalArray = Array2D.zeroCreate<'T> N M @@ -444,141 +287,82 @@ let secondRow = test1.[1,*] let firstCol = test1.[*,0] printfn "%A" firstCol - ``` - - - - ### Boolean Functions on Arrays + The functions [Array.exists](http://msdn.microsoft.com/en-us/library/8e47ad6c-c065-4876-8cb4-ec960ec3e5c9) and [Array.exists2](http://msdn.microsoft.com/en-us/library/2e384a6a-f99d-4e23-b677-250ffbc1dd8e) test elements in either one or two arrays, respectively. These functions take a test function and return **true** if there is an element (or element pair for **Array.exists2**) that satisfies the condition. The following code demonstrates the use of **Array.exists** and **Array.exists2**. In these examples, new functions are created by applying only one of the arguments, in these cases, the function argument. [!code-fsharp[Main](snippets/fsarrays/snippet23.fs)] - The output of the preceding code is as follows. - - +The output of the preceding code is as follows. ``` - - - - true false false true - - ``` - - - Similarly, the function [Array.forall](http://msdn.microsoft.com/en-us/library/d88f2cd0-fa7f-45cf-ac15-31eae9086cc4) tests an array to determine whether every element satisfies a Boolean condition. The variation [Array.forall2](http://msdn.microsoft.com/en-us/library/c68f61a1-030c-4024-b705-c4768b6c96b9) does the same thing by using a Boolean function that involves elements of two arrays of equal length. The following code illustrates the use of these functions. [!code-fsharp[Main](snippets/fsarrays/snippet24.fs)] - The output for these examples is as follows. - - +The output for these examples is as follows. ``` - - - - false true true false - - ``` - - - - ### Searching Arrays -[Array.find](http://msdn.microsoft.com/en-us/library/db6d920a-de19-4520-85a4-d83de77c1b33) takes a Boolean function and returns the first element for which the function returns **true**, or raises a **T:System.Collections.Generic.KeyNotFoundException** if no element that satisfies the condition is found. [Array.findIndex](http://msdn.microsoft.com/en-us/library/5ae3a8f9-7b8f-44ea-a740-d5700f4d899f) is like **Array.find**, except that it returns the index of the element instead of the element itself. + +[Array.find](http://msdn.microsoft.com/en-us/library/db6d920a-de19-4520-85a4-d83de77c1b33) takes a Boolean function and returns the first element for which the function returns **true**, or raises a **System.Collections.Generic.KeyNotFoundException** if no element that satisfies the condition is found. [Array.findIndex](http://msdn.microsoft.com/en-us/library/5ae3a8f9-7b8f-44ea-a740-d5700f4d899f) is like **Array.find**, except that it returns the index of the element instead of the element itself. The following code uses **Array.find** and **Array.findIndex** to locate a number that is both a perfect square and perfect cube. [!code-fsharp[Main](snippets/fsarrays/snippet25.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - The first element that is both a square and a cube is 64 and its index is 62. - - ``` - - - [Array.tryFind](http://msdn.microsoft.com/en-us/library/7bd65f6c-df77-454c-ac3a-6f7baecec9d9) is like **Array.find**, except that its result is an option type, and it returns **None** if no element is found. **Array.tryFind** should be used instead of **Array.find** when you do not know whether a matching element is in the array. Similarly, [Array.tryFindIndex](http://msdn.microsoft.com/en-us/library/da82f7fe-95e9-4fd5-a924-cd3c9d10618a) is like [Array.findIndex](http://msdn.microsoft.com/en-us/library/5ae3a8f9-7b8f-44ea-a740-d5700f4d899f) except that the option type is the return value. If no element is found, the option is **None**. The following code demonstrates the use of **Array.tryFind**. This code depends on the previous code. [!code-fsharp[Main](snippets/fsarrays/snippet26.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - Found an element: 1 Found an element: 729 - - ``` - - - Use [Array.tryPick](http://msdn.microsoft.com/en-us/library/72d45f85-037b-43a9-97fd-17239f72713e) when you need to transform an element in addition to finding it. The result is the first element for which the function returns the transformed element as an option value, or **None** if no such element is found. The following code shows the use of **Array.tryPick**. In this case, instead of a lambda expression, several local helper functions are defined to simplify the code. [!code-fsharp[Main](snippets/fsarrays/snippet27.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - Found an element 1 with square root 1 and cube root 1. Found an element 64 with square root 8 and cube root 4. Found an element 729 with square root 27 and cube root 9. Found an element 4096 with square root 64 and cube root 16. - - ``` - - - - ### Performing Computations on Arrays + The [Array.average](http://msdn.microsoft.com/en-us/library/7029f2b9-91ea-41cb-be1b-466a5a0db20e) function returns the average of each element in an array. It is limited to element types that support exact division by an integer, which includes floating point types but not integral types. The [Array.averageBy](http://msdn.microsoft.com/en-us/library/e9d64609-06a3-48f0-bc07-226ab0f85c54) function returns the average of the results of calling a function on each element. For an array of integral type, you can use **Array.averageBy** and have the function convert each element to a floating point type for the computation. Use [Array.max](http://msdn.microsoft.com/en-us/library/f03fbda0-fce6-40e2-a85d-79c9d81f710b) or [Array.min](http://msdn.microsoft.com/en-us/library/d6b3da5f-bac0-4355-9846-4b72d95bc3fd) to get the maximum or minimum element, if the element type supports it. Similarly, [Array.maxBy](http://msdn.microsoft.com/en-us/library/18dbe7c5-482e-4766-8e01-12a76f847045) and [Array.minBy](http://msdn.microsoft.com/en-us/library/24091583-be78-4cc9-9fab-de6d7506af4f) allow a function to be executed first, perhaps to transform to a type that supports comparison. @@ -593,47 +377,35 @@ The functions [Array.fold](http://msdn.microsoft.com/en-us/library/5ed9dd3b-3694 These functions for performing computations correspond to the functions of the same name in the [List module](http://msdn.microsoft.com/en-us/library/a2264ba3-2d45-40dd-9040-4f7aa2ad9788). For usage examples, see [Lists (F#)](Lists-%5BFSharp%5D.md). - ### Modifying Arrays + [Array.set](http://msdn.microsoft.com/en-us/library/847edc0d-4dc5-4a39-98c7-d4320c60e790) sets an element to a specified value. [Array.fill](http://msdn.microsoft.com/en-us/library/c83c9886-81d9-44f9-a195-61c7b87f7df2) sets a range of elements in an array to a specified value. The following code provides an example of **Array.fill**. [!code-fsharp[Main](snippets/fsarrays/snippet28.fs)] - The output is as follows. - - +The output is as follows. ``` - - - - [|1; 2; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 23; 24; 25|] - - ``` - - - You can use [Array.blit](http://msdn.microsoft.com/en-us/library/675e13e4-7fb9-4e0d-a5be-a112830de667) to copy a subsection of one array to another array. - ### Converting to and from Other Types -[Array.ofList](http://msdn.microsoft.com/en-us/library/e7225239-f561-45a4-b0b5-69a1cdcae78b) creates an array from a list. [Array.ofSeq](http://msdn.microsoft.com/en-us/library/6bedf5e0-4b22-46da-b09c-6aa09eff220c) creates an array from a sequence. [Array.toList](http://msdn.microsoft.com/en-us/library/4deff724-0be4-4688-92e7-9d67a1097786) and [Array.toSeq](http://msdn.microsoft.com/en-us/library/ac28dbab-406c-4fe0-ab08-c1ce5e247af4) convert to these other collection types from the array type. +[Array.ofList](http://msdn.microsoft.com/en-us/library/e7225239-f561-45a4-b0b5-69a1cdcae78b) creates an array from a list. [Array.ofSeq](http://msdn.microsoft.com/en-us/library/6bedf5e0-4b22-46da-b09c-6aa09eff220c) creates an array from a sequence. [Array.toList](http://msdn.microsoft.com/en-us/library/4deff724-0be4-4688-92e7-9d67a1097786) and [Array.toSeq](http://msdn.microsoft.com/en-us/library/ac28dbab-406c-4fe0-ab08-c1ce5e247af4) convert to these other collection types from the array type. ### Sorting Arrays -Use [Array.sort](http://msdn.microsoft.com/en-us/library/c6679075-e7eb-463c-9be5-c89be140c312) to sort an array by using the generic comparison function. Use [Array.sortBy](http://msdn.microsoft.com/en-us/library/144498dc-091d-4575-a229-c0bcbd61426b) to specify a function that generates a value, referred to as a *key*, to sort by using the generic comparison function on the key. Use [Array.sortWith](http://msdn.microsoft.com/en-us/library/699d3638-4244-4f42-8496-45f53d43ce95) if you want to provide a custom comparison function. **Array.sort**, **Array.sortBy**, and **Array.sortWith** all return the sorted array as a new array. The variations [Array.sortInPlace](http://msdn.microsoft.com/en-us/library/36f39947-8a88-4823-9e9b-e9d838d292e0), [Array.sortInPlaceBy](http://msdn.microsoft.com/en-us/library/7fb9d2dd-d461-4c67-8b43-b5c59fc12c3f), and [Array.sortInPlaceWith](http://msdn.microsoft.com/en-us/library/454f9e11-972d-47a6-a854-8031cb0c7b0b) modify the existing array instead of returning a new one. +Use [Array.sort](http://msdn.microsoft.com/en-us/library/c6679075-e7eb-463c-9be5-c89be140c312) to sort an array by using the generic comparison function. Use [Array.sortBy](http://msdn.microsoft.com/en-us/library/144498dc-091d-4575-a229-c0bcbd61426b) to specify a function that generates a value, referred to as a *key*, to sort by using the generic comparison function on the key. Use [Array.sortWith](http://msdn.microsoft.com/en-us/library/699d3638-4244-4f42-8496-45f53d43ce95) if you want to provide a custom comparison function. **Array.sort**, **Array.sortBy**, and **Array.sortWith** all return the sorted array as a new array. The variations [Array.sortInPlace](http://msdn.microsoft.com/en-us/library/36f39947-8a88-4823-9e9b-e9d838d292e0), [Array.sortInPlaceBy](http://msdn.microsoft.com/en-us/library/7fb9d2dd-d461-4c67-8b43-b5c59fc12c3f), and [Array.sortInPlaceWith](http://msdn.microsoft.com/en-us/library/454f9e11-972d-47a6-a854-8031cb0c7b0b) modify the existing array instead of returning a new one. ### Arrays and Tuples -The functions [Array.zip](http://msdn.microsoft.com/en-us/library/23e086b8-b266-4db2-8b68-e88e6a8e2187) and [Array.unzip](http://msdn.microsoft.com/en-us/library/a529b47c-2e2b-4f79-ad44-c578432d2f48) convert arrays of tuple pairs to tuples of arrays and vice versa. [Array.zip3](http://msdn.microsoft.com/en-us/library/1745744a-d2ca-4c3e-b825-3f15d9f4000d) and [Array.unzip3](http://msdn.microsoft.com/en-us/library/bc3e6db0-f334-444f-8c30-813942880677) are similar except that they work with tuples of three elements or tuples of three arrays. +The functions [Array.zip](http://msdn.microsoft.com/en-us/library/23e086b8-b266-4db2-8b68-e88e6a8e2187) and [Array.unzip](http://msdn.microsoft.com/en-us/library/a529b47c-2e2b-4f79-ad44-c578432d2f48) convert arrays of tuple pairs to tuples of arrays and vice versa. [Array.zip3](http://msdn.microsoft.com/en-us/library/1745744a-d2ca-4c3e-b825-3f15d9f4000d) and [Array.unzip3](http://msdn.microsoft.com/en-us/library/bc3e6db0-f334-444f-8c30-813942880677) are similar except that they work with tuples of three elements or tuples of three arrays. ## Parallel Computations on Arrays -The module [Array.Parallel](http://msdn.microsoft.com/en-us/library/60f30b77-5af4-4050-9a5c-bcdb3f5cbb09) contains functions for performing parallel computations on arrays. This module is not available in applications that target versions of the .NET Framework prior to version 4. +The module [Array.Parallel](http://msdn.microsoft.com/en-us/library/60f30b77-5af4-4050-9a5c-bcdb3f5cbb09) contains functions for performing parallel computations on arrays. This module is not available in applications that target versions of the .NET Framework prior to version 4. ## See Also [F# Language Reference](FSharp-Language-Reference.md)