diff --git a/docs/conceptual/array.exactlyone['t]-function-[fsharp].md b/docs/conceptual/array.exactlyone['t]-function-[fsharp].md new file mode 100644 index 00000000..611bcdb4 --- /dev/null +++ b/docs/conceptual/array.exactlyone['t]-function-[fsharp].md @@ -0,0 +1,68 @@ +--- +title: Array.exactlyOne<'T> Function (F#) +description: Array.exactlyOne<'T> Function (F#) +keywords: visual f#, f#, functional programming +author: erikschierboom +manager: danielfe +ms.date: 03/13/2017 +ms.topic: language-reference +ms.prod: visual-studio-dev14 +ms.technology: devlang-fsharp +ms.assetid: e8315847-d65e-49c9-8cf2-450b8b395ffc +--- + +# Array.exactlyOne<'T> Function (F#) + +Returns the only element of the array. + +**Namespace/Module Path**: Microsoft.FSharp.Collections.Array + +**Assembly**: FSharp.Core (in FSharp.Core.dll) + + +## Syntax + +```fsharp +// Signature: +Array.exactlyOne : 'T [] -> 'T + +// Usage: +Array.exactlyOne array +``` + +#### Parameters +*array* +Type: **'T**[[]](https://msdn.microsoft.com/library/def20292-9aae-4596-9275-b94e594f8493) + + +The input array. + +## Exceptions +|Exception|Condition| +|----|----| +|[ArgumentException](https://msdn.microsoft.com/library/system.argumentexception.aspx)|Thrown when the input does not have precisely one element.| +|[ArgumentNullException](https://msdn.microsoft.com/library/system.argumentnullexception.aspx)|Thrown when the input array is null| + + +## Return Value +The last element of the array. + + +## Remarks +This function is named `ExactlyOne` in the .NET assembly. If accessing the member 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 + + +## Version Information +**F# Core Library Versions** + +Supported in: 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/collections.array-module-[fsharp].md b/docs/conceptual/collections.array-module-[fsharp].md index 2b663b0c..455e707b 100644 --- a/docs/conceptual/collections.array-module-[fsharp].md +++ b/docs/conceptual/collections.array-module-[fsharp].md @@ -48,6 +48,7 @@ For an overview of arrays in F#, see [Arrays (F#)](Arrays-%5BFSharp% |[`create`](https://msdn.microsoft.com/library/e848c8d6-1142-4080-9727-8dacc26066be)
**: int -> 'T -> 'T []**|Creates an array whose elements are all initially the supplied value.| |[`distinct`](array.distinct%5B't%5D-function-%5Bfsharp%5D.md)
**: 'T [] -> 'T []**|Returns an array that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the array then the later occurrences are discarded.| |[`empty`](https://msdn.microsoft.com/library/c3694b92-1c16-4c54-9bf2-fe398fadce32)
**: 'T []**|Returns an empty array of the given type.| +|[exactlyOne](https://msdn.microsoft.com/library/bd14fd21-b645-4416-98e4-6a6c49f3a15c)
**: 'T [] -> 'T**|Returns the only element of the array.| |[`exists`](https://msdn.microsoft.com/library/8e47ad6c-c065-4876-8cb4-ec960ec3e5c9)
**: ('T -> bool) -> 'T [] -> bool**|Tests whether any element of an array satisfies the supplied predicate.| |[`exists2`](https://msdn.microsoft.com/library/2e384a6a-f99d-4e23-b677-250ffbc1dd8e)
**: ('T1 -> 'T2 -> bool) -> 'T1 [] -> 'T2 [] -> bool**|Tests whether any pair of corresponding elements of two arrays satisfy the supplied condition.| |[`fill`](https://msdn.microsoft.com/library/c83c9886-81d9-44f9-a195-61c7b87f7df2)
**: 'T [] -> int -> int -> 'T -> unit**|Fills a range of elements of an array with the supplied value.|