Table of contents
TOC
Collapse the table of content
Expand the table of content

Seq.where<'T> Function (F#)

Den Delimarsky|Last Updated: 7/25/2016
|
1 Contributor

Returns a new collection containing only the elements of the collection for which the given predicate returns true.

Namespace/Module Path: Microsoft.FSharp.Collections.Seq

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

// Signature:where : ('T -> bool) -> seq<'T> -> seq<'T>// Usage:Seq.where predicate source

Parameters

predicate Type: 'T -> bool

A function to test whether each item in the input sequence should be included in the output.

source Type: seq<'T>

The input sequence.

Exceptions

ExceptionCondition
ArgumentNullExceptionThrown when the input sequence is null.

Return Value

The result sequence.

Remarks

The returned sequence may be passed between threads safely. However, individual System.Collections.Generic.IEnumerator values generated from the returned sequence should not be accessed concurrently. Remember that sequence is subject to lazy evaluation, which means that effects are delayed until it is enumerated. This function is a synonym for Seq.filter.

This function is named Where 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: 2.0, 4.0, Portable

See Also

Collections.Seq Module (F#)

Microsoft.FSharp.Collections Namespace (F#)

Seq.filter<'T> Function (F#)

© 2017 Microsoft