diff --git a/docs/conceptual/array.head['t]-function-[fsharp].md b/docs/conceptual/array.head['t]-function-[fsharp].md new file mode 100644 index 00000000..fd5d82d9 --- /dev/null +++ b/docs/conceptual/array.head['t]-function-[fsharp].md @@ -0,0 +1,68 @@ +--- +title: Array.head<'T> Function (F#) +description: Array.head<'T> Function (F#) +keywords: visual f#, f#, functional programming +author: erikschierboom +manager: danielfe +ms.date: 03/12/2017 +ms.topic: language-reference +ms.prod: visual-studio-dev14 +ms.technology: devlang-fsharp +ms.assetid: 3c376852-11f0-4286-9210-6d8a719ae626 +--- + +# Array.head<'T> Function (F#) + +Returns the first element of the array. + +**Namespace/Module Path:** Microsoft.FSharp.Collections.Array + +**Assembly:** FSharp.Core (in FSharp.Core.dll) + + +## Syntax + +```fsharp +// Signature: +Array.head : 'T[] -> 'T + +// Usage: +Array.head 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 array is empty.| + +## Return Value + +The first element of the array. + +## Remarks +Raises `System.ArgumentException` if *array* is empty + +This function is named `Head` 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 + + +## 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) \ No newline at end of file diff --git a/docs/conceptual/collections.array-module-[fsharp].md b/docs/conceptual/collections.array-module-[fsharp].md index f99d8bae..2b663b0c 100644 --- a/docs/conceptual/collections.array-module-[fsharp].md +++ b/docs/conceptual/collections.array-module-[fsharp].md @@ -60,6 +60,7 @@ For an overview of arrays in F#, see [Arrays (F#)](Arrays-%5BFSharp% |[`foldBack2`](https://msdn.microsoft.com/library/aa51b405-df20-4c51-9998-a6530f7db862)
**: ('T1 -> 'T2 -> 'State -> 'State) -> 'T1 [] -> 'T2 [] -> 'State -> 'State**|Applies a function to pairs of elements from two supplied arrays, right-to-left, threading an accumulator argument through the computation. The two input arrays must have the same lengths; otherwise, **System.ArgumentException** is raised.| |[`forall`](https://msdn.microsoft.com/library/d88f2cd0-fa7f-45cf-ac15-31eae9086cc4)
**: ('T -> bool) -> 'T [] -> bool**|Tests whether all elements of an array satisfy the supplied condition.| |[`forall2`](https://msdn.microsoft.com/library/c68f61a1-030c-4024-b705-c4768b6c96b9)
**: ('T1 -> 'T2 -> bool) -> 'T1 [] -> 'T2 [] -> bool**|Tests whether all corresponding elements of two supplied arrays satisfy a supplied condition.| +|[head](https://msdn.microsoft.com/library/3c376852-11f0-4286-9210-6d8a719ae626)
**: 'T [] -> 'T**|Returns the first element of the array.| |[`get`](https://msdn.microsoft.com/library/dd93e85d-7e80-4d76-8de0-b6d45bcf07bc)
**: 'T [] -> int -> 'T**|Gets an element from an array.| |[`init`](https://msdn.microsoft.com/library/ee898089-63b0-40aa-910c-5ae7e32f6665)
**: int -> (int -> 'T) -> 'T []**|Uses a supplied function to create an array of the supplied dimension.| |[`isEmpty`](https://msdn.microsoft.com/library/c2bd48e9-8aba-4bea-ad84-17352886d3a8)
**: 'T [] -> bool**|Tests whether an array has any elements.|