[Home] Module Microsoft.FSharp.MLLib.IEnumerable


Basic operations on IEnumerables.

Values

ValueDescription
val append : #IEnumerable<'a> -> #IEnumerable<'a> -> IEnumerable<'a>
Wrap the two given enumeration-of-enumerations as a single concatenated enumeration.
val choose : ('a -> 'b option) -> #IEnumerable<'a> -> IEnumerable<'b>
Apply the given function to each element of the list. Return the list comprised of the results "x" for each element where the function returns Some(x)
val concat : #IEnumerable<'b> -> IEnumerable<'a> when 'b :> IEnumerable<'a>
Wrap the given enumeration-of-enumerations as a single concatenated enumeration.
val empty : unit -> IEnumerable<'a>
Create an empty IEnumerable
val exists : ('a -> bool) -> #IEnumerable<'a> -> bool
Test if any element of the collection satisfies the given predicate. If the elements are "i0...iN" then computes "p i0 or ... or p iN".
val filter : ('a -> bool) -> #IEnumerable<'a> -> IEnumerable<'a>
Return a new collection containing only the elements of the collection for which the given predicate returns "true"
val find : ('a -> bool) -> #IEnumerable<'a> -> 'a
Return the first element for which the given function returns "true". Raise Not_found if no such element exists.
val first : ('a -> 'b option) -> #IEnumerable<'a> -> 'b option
Apply the given function to successive elements, returning the first result where function returns "Some(x)" for some x.
val fold : ('b -> 'a -> 'b) -> 'b -> #IEnumerable<'a> -> 'b
Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f (... (f s i0)...) iN"
val for_all : ('a -> bool) -> #IEnumerable<'a> -> bool
Test if all elements of the collection satisfy the given predicate. If the elements are "i0...iN" then computes "p i0 && ... && p iN".
val hd : #IEnumerable<'a> -> 'a
Return the first element of the IEnumerable. Raise (Invalid_argument "hd") if undefined.
val init_finite : int -> (int -> 'a) -> IEnumerable<'a>
Generate a new IEnumerable which, when iterated, will return successive elements by calling the given function, up to the given count. The results of calling the function will not be saved, i.e. the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated.
val init_infinite : (int -> 'a) -> IEnumerable<'a>
Generate a new IEnumerable which, when iterated, will return successive elements by calling the given function. The results of calling the function will not be saved, i.e. the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated
val iter : ('a -> unit) -> #IEnumerable<'a> -> unit
Apply the given function to each element of the collection.
val length : #IEnumerable<'a> -> int
Return the length of the IEnumerable
val map : ('a -> 'b) -> #IEnumerable<'a> -> IEnumerable<'b>
Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function will be applied as elements are demanded using the 'Current' property on iterators retrieved from the object. Generating multiple iterators or calling the 'Current' property multiple times may result in the function being called multiple times.
val map_with_type : ('a -> 'b) -> #IEnumerable -> IEnumerable<'b>
Transform a loosely-typed System.Collections IEnumerable to a new collection whose elements are the results of applying the given function to each of the elements of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val nonempty : #IEnumerable<'a> -> bool
Return true if the IEnumerable is not empty.
val of_array : 'a array -> IEnumerable<'a>
Build a collection from the given array
val of_list : 'a list -> IEnumerable<'a>
Build a collection from the given array
val take : int -> #IEnumerable<'a> -> 'a list
Return the first N elements of the IEnumerable. Raise (Invalid_argument "take") if undefined.
val to_array : #IEnumerable<'a> -> 'a array
Build an array from the given collection
val to_list : #IEnumerable<'a> -> 'a list
Build a list from the given collection
val tryfind : ('a -> bool) -> #IEnumerable<'a> -> 'a option
Return the first element for which the given function returns "true". Return None if no such element exists.
val unfold : ('b -> ('a * 'b) option) -> 'b -> IEnumerable<'a>
Return an IEnumerable that logically contains the elements returned by the given computation. The given computation is not executed until the first element on the stream is consumed. The given argument is passed to the computation. Subsequent elements in the stream are generated by again applying the residual 'b to the computation. The stream will be recomputed each time an enumerator is requested via GetEnumerator.
val untyped_filter : ('a -> bool) -> #IEnumerable -> IEnumerable
Return a new collection containing only the elements of the collection for which the given predicate returns "true" The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val untyped_fold : ('b -> 'a -> 'b) -> 'b -> #IEnumerable -> 'b
Apply a function to each element of the collection, threading an 'accumulator' argument through the computation. If the elements are "i0...iN" then computes "f (... (f s i0)...) iN" The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val untyped_iter : ('a -> unit) -> #IEnumerable -> unit
Apply the given function to each element of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val untyped_map : ('a -> 'b) -> #IEnumerable -> IEnumerable
Build a new collection whose elements are the results of applying the given function to each of the elements of the collection. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val untyped_to_list : #IEnumerable -> 'a list
Transform a loosely-typed System.Collections IEnumerable to a strongly typed F# list. The use of thus function usually requires a type annotation. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.
val untyped_to_typed : #IEnumerable -> IEnumerable<'a>
Wrap a loosely-typed System.Collections IEnumerable as a typed System.Collections.Generic.IEnumerable. The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors.

See Also

Microsoft.FSharp.MLLib


Documentation for assembly mllib, version 1.1.10.1, generated using F# version 1.1.10.1