FSharpPlus


NonEmptyList Module

Basic operations on NonEmptyList

Functions and values

Function or value Description

NonEmptyList.allPairs list1 list2

Full Usage: NonEmptyList.allPairs list1 list2

Parameters:
Returns: NonEmptyList<'T * 'U> The resulting list of pairs.
Modifiers: inline
Type parameters: 'T, 'U

Returns a new list that contains all pairings of elements from two lists.

list1 : NonEmptyList<'T>

The first input list.

list2 : NonEmptyList<'U>

The second input list.

Returns: NonEmptyList<'T * 'U>

The resulting list of pairs.

NonEmptyList.append list1 list2

Full Usage: NonEmptyList.append list1 list2

Parameters:
Returns: NonEmptyList<'T> The resulting list.
Modifiers: inline
Type parameters: 'T

Concatenates two lists.

list1 : NonEmptyList<'T>

The first input list.

list2 : NonEmptyList<'T>

The second input list.

Returns: NonEmptyList<'T>

The resulting list.

NonEmptyList.average list

Full Usage: NonEmptyList.average list

Parameters:
Returns: ^T The resulting average.
Modifiers: inline
Type parameters: ^T

Returns the average of the elements in the list.

list : NonEmptyList<^T>

The input list.

Returns: ^T

The resulting average.

NonEmptyList.averageBy projection list

Full Usage: NonEmptyList.averageBy projection list

Parameters:
    projection : 'T -> ^U - The function to transform the list elements into the type to be averaged.
    list : NonEmptyList<'T> - The input list.

Returns: ^U The resulting average.
Modifiers: inline
Type parameters: 'T, ^U

Returns the average of the elements generated by applying the function to each element of the list.

projection : 'T -> ^U

The function to transform the list elements into the type to be averaged.

list : NonEmptyList<'T>

The input list.

Returns: ^U

The resulting average.

NonEmptyList.choice list

Full Usage: NonEmptyList.choice list

Parameters:
Returns: ^Alt<'T>
Modifiers: inline
Type parameters: ^Alt<'T>

Reduces using alternative operator `<|>`.

list : NonEmptyList<^Alt<'T>>
Returns: ^Alt<'T>

NonEmptyList.choose chooser list

Full Usage: NonEmptyList.choose chooser list

Parameters:
    chooser : 'T -> 'a option - The function to be applied to the list elements.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'a> The resulting list comprising the values v where the chooser function returned Some(x).
Modifiers: inline
Type parameters: 'T, 'a

Applies a function to each element in a list and then returns a list of values v where the applied function returned Some(v).

chooser : 'T -> 'a option

The function to be applied to the list elements.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'a>

The resulting list comprising the values v where the chooser function returned Some(x).

ArgumentException Thrown when the chooser function returns None for all elements.

NonEmptyList.chunkBySize chunkSize list

Full Usage: NonEmptyList.chunkBySize chunkSize list

Parameters:
    chunkSize : int - The maximum size of each chunk.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<NonEmptyList<'T>> The list divided into chunks.
Modifiers: inline
Type parameters: 'T

Divides the input list into lists (chunks) of size at most chunkSize. Returns a new list containing the generated lists (chunks) as its elements.

chunkSize : int

The maximum size of each chunk.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<NonEmptyList<'T>>

The list divided into chunks.

NonEmptyList.collect mapping list

Full Usage: NonEmptyList.collect mapping list

Parameters:
    mapping : 'T -> 'a seq - The function to transform each input element into a sublist to be concatenated.
    list : NonEmptyList<'T> - The input list.

Returns: 'a seq The concatenation of the transformed sublists.
Modifiers: inline
Type parameters: 'T, 'a

For each element of the list, applies the given function. Concatenates all the results and returns the combined list.

mapping : 'T -> 'a seq

The function to transform each input element into a sublist to be concatenated.

list : NonEmptyList<'T>

The input list.

Returns: 'a seq

The concatenation of the transformed sublists.

ArgumentException Thrown when the mapping function returns an empty list for all element.

NonEmptyList.compareWith comparer list1 list2

Full Usage: NonEmptyList.compareWith comparer list1 list2

Parameters:
    comparer : 'T -> 'T -> int - A function that takes an element from each list and returns an int. If it evaluates to a non-zero value iteration is stopped and that value is returned.
    list1 : NonEmptyList<'T> - The first input list.
    list2 : NonEmptyList<'T> - The second input list.

Returns: int Returns the first non-zero result from the comparison function. If the first list has a larger element, the return value is always positive. If the second list has a larger element, the return value is always negative. When the elements are equal in the two lists, 1 is returned if the first list is longer, 0 is returned if they are equal in length, and -1 is returned when the second list is longer.
Modifiers: inline
Type parameters: 'T

Compares two lists using the given comparison function, element by element.

comparer : 'T -> 'T -> int

A function that takes an element from each list and returns an int. If it evaluates to a non-zero value iteration is stopped and that value is returned.

list1 : NonEmptyList<'T>

The first input list.

list2 : NonEmptyList<'T>

The second input list.

Returns: int

Returns the first non-zero result from the comparison function. If the first list has a larger element, the return value is always positive. If the second list has a larger element, the return value is always negative. When the elements are equal in the two lists, 1 is returned if the first list is longer, 0 is returned if they are equal in length, and -1 is returned when the second list is longer.

NonEmptyList.concat lists

Full Usage: NonEmptyList.concat lists

Parameters:
Returns: NonEmptyList<'T> The resulting concatenated list.
Modifiers: inline
Type parameters: 'T

Returns a new list that contains the elements of each of the lists in order.

lists : NonEmptyList<NonEmptyList<'T>>

The input list of lists.

Returns: NonEmptyList<'T>

The resulting concatenated list.

NonEmptyList.cons e arg2

Full Usage: NonEmptyList.cons e arg2

Parameters:
Returns: NonEmptyList<'a> A new list with the element added to the beginning.

Adds an element to the beginning of the given list

e : 'a
arg1 : NonEmptyList<'a>
Returns: NonEmptyList<'a>

A new list with the element added to the beginning.

NonEmptyList.contains value list

Full Usage: NonEmptyList.contains value list

Parameters:
    value : 'T - The value to locate in the input list.
    list : NonEmptyList<'T> - The input list.

Returns: bool True if the input list contains the specified element; false otherwise.
Modifiers: inline
Type parameters: 'T

Tests if the list contains the specified element.

value : 'T

The value to locate in the input list.

list : NonEmptyList<'T>

The input list.

Returns: bool

True if the input list contains the specified element; false otherwise.

NonEmptyList.countBy projection list

Full Usage: NonEmptyList.countBy projection list

Parameters:
    projection : 'T -> 'U - A function transforming each item of the input list into a key to be compared against the others.
    list : NonEmptyList<'T> - The input list.

Returns: ('U * int) seq The resulting list of unique keys and their number of occurrences.
Modifiers: inline
Type parameters: 'T, 'U

Applies a key-generating function to each element of a list and returns a list yielding unique keys and their number of occurrences in the original list.

projection : 'T -> 'U

A function transforming each item of the input list into a key to be compared against the others.

list : NonEmptyList<'T>

The input list.

Returns: ('U * int) seq

The resulting list of unique keys and their number of occurrences.

NonEmptyList.create x xs

Full Usage: NonEmptyList.create x xs

Parameters:
    x : 'a
    xs : 'a list

Returns: NonEmptyList<'a>

Builds a non empty list.

x : 'a
xs : 'a list
Returns: NonEmptyList<'a>

NonEmptyList.distinct list

Full Usage: NonEmptyList.distinct list

Parameters:
Returns: NonEmptyList<'T> The resulting list without duplicates.

Returns a list that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the list then the later occurrences are discarded.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The resulting list without duplicates.

NonEmptyList.distinctBy projection list

Full Usage: NonEmptyList.distinctBy projection list

Parameters:
    projection : 'T -> 'U - A function transforming the list items into comparable keys.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The resulting list.
Modifiers: inline
Type parameters: 'T, 'U

Returns a list that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the list then the later occurrences are discarded.

projection : 'T -> 'U

A function transforming the list items into comparable keys.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The resulting list.

NonEmptyList.exactlyOne list

Full Usage: NonEmptyList.exactlyOne list

Parameters:
Returns: 'T The only element of the list.
Modifiers: inline
Type parameters: 'T

Returns the only element of the list.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The only element of the list.

ArgumentException Thrown when the input does not have precisely one element.

NonEmptyList.except itemsToExclude list

Full Usage: NonEmptyList.except itemsToExclude list

Parameters:
    itemsToExclude : 'a - The sequence of items to exclude from the input list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> A list that contains the distinct elements of list that do not appear in itemsToExclude.
Modifiers: inline
Type parameters: 'a, 'T

Returns a new list with the distinct elements of the input list which do not appear in the itemsToExclude sequence, using generic hash and equality comparisons to compare values.

itemsToExclude : 'a

The sequence of items to exclude from the input list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

A list that contains the distinct elements of list that do not appear in itemsToExclude.

ArgumentException Thrown when itemsToExclude is null.

NonEmptyList.exists predicate list

Full Usage: NonEmptyList.exists predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: bool True if any element satisfies the predicate.
Modifiers: inline
Type parameters: 'T

Tests if any element of the list satisfies the given predicate.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: bool

True if any element satisfies the predicate.

NonEmptyList.exists2 predicate list1 list2

Full Usage: NonEmptyList.exists2 predicate list1 list2

Parameters:
    predicate : 'T1 -> 'T2 -> bool - The function to test the input elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Returns: bool True if any pair of elements satisfy the predicate.
Modifiers: inline
Type parameters: 'T1, 'T2

Tests if any pair of corresponding elements of the lists satisfies the given predicate.

predicate : 'T1 -> 'T2 -> bool

The function to test the input elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

Returns: bool

True if any pair of elements satisfy the predicate.

ArgumentException Thrown when the input lists are of different lengths.

NonEmptyList.filter predicate list

Full Usage: NonEmptyList.filter predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> A list containing only the elements that satisfy the predicate.
Modifiers: inline
Type parameters: 'T

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

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

A list containing only the elements that satisfy the predicate.

ArgumentException Thrown when the predicate evaluates to false for all the elements of the list.

NonEmptyList.find predicate list

Full Usage: NonEmptyList.find predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The first element that satisfies the predicate.
Modifiers: inline
Type parameters: 'T

Returns the first element for which the given function returns True. Raises KeyNotFoundException if no such element exists.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The first element that satisfies the predicate.

KeyNotFoundException Thrown if the predicate evaluates to false for all the elements of the list.

NonEmptyList.findBack predicate list

Full Usage: NonEmptyList.findBack predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The first element that satisfies the predicate.
Modifiers: inline
Type parameters: 'T

Returns the last element for which the given function returns True. Raises KeyNotFoundException if no such element exists.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The first element that satisfies the predicate.

KeyNotFoundException Thrown if the predicate evaluates to false for all the elements of the list.

NonEmptyList.findIndex predicate list

Full Usage: NonEmptyList.findIndex predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: int The first element that satisfies the predicate.
Modifiers: inline
Type parameters: 'T

Returns the index of the first element in the list that satisfies the given predicate. Raises KeyNotFoundException if no such element exists.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: int

The first element that satisfies the predicate.

KeyNotFoundException Thrown if the predicate evaluates to false for all the elements of the list.

NonEmptyList.findIndexBack predicate list

Full Usage: NonEmptyList.findIndexBack predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: int The first element that satisfies the predicate.
Modifiers: inline
Type parameters: 'T

Returns the index of the last element in the list that satisfies the given predicate. Raises KeyNotFoundException if no such element exists.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: int

The first element that satisfies the predicate.

KeyNotFoundException Thrown if the predicate evaluates to false for all the elements of the list.

NonEmptyList.fold folder state list

Full Usage: NonEmptyList.fold folder state list

Parameters:
    folder : 'State -> 'T -> 'State - The function to update the state given the input elements.
    state : 'State - The initial state.
    list : NonEmptyList<'T> - The input list.

Returns: 'State The final state value.
Modifiers: inline
Type parameters: 'State, 'T

Applies a function to each element of the collection, threading an accumulator argument through the computation. Take the second argument, and apply the function to it and the first element of the list. Then feed this result into the function along with the second element and so on. Return the final result. If the input function is f and the elements are i0...iN then computes f (... (f s i0) i1 ...) iN.

folder : 'State -> 'T -> 'State

The function to update the state given the input elements.

state : 'State

The initial state.

list : NonEmptyList<'T>

The input list.

Returns: 'State

The final state value.

NonEmptyList.fold2 folder state list1 list2

Full Usage: NonEmptyList.fold2 folder state list1 list2

Parameters:
    folder : 'State -> 'T1 -> 'T2 -> 'State - The function to update the state given the input elements.
    state : 'State - The initial state.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Returns: 'State The final state value.
Modifiers: inline
Type parameters: 'State, 'T1, 'T2

Applies a function to corresponding elements of two collections, threading an accumulator argument through the computation. The collections must have identical sizes. If the input function is f and the elements are i0...iN and j0...jN then computes f (... (f s i0 j0)...) iN jN.

folder : 'State -> 'T1 -> 'T2 -> 'State

The function to update the state given the input elements.

state : 'State

The initial state.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

Returns: 'State

The final state value.

NonEmptyList.foldBack folder list state

Full Usage: NonEmptyList.foldBack folder list state

Parameters:
    folder : 'T -> 'State -> 'State - The function to update the state given the input elements.
    list : NonEmptyList<'T> - The input list.
    state : 'State - The initial state.

Returns: 'State The final state value.
Modifiers: inline
Type parameters: 'T, 'State

Applies a function to each element of the collection, starting from the end, threading an accumulator argument through the computation. Take the second argument, and apply the function to it and the first element of the list. Then feed this result into the function along with the second element and so on. Return the final result. If the input function is f and the elements are i0...iN then computes f i0 (...(f iN s)).

folder : 'T -> 'State -> 'State

The function to update the state given the input elements.

list : NonEmptyList<'T>

The input list.

state : 'State

The initial state.

Returns: 'State

The final state value.

NonEmptyList.foldBack2 folder list1 list2 state

Full Usage: NonEmptyList.foldBack2 folder list1 list2 state

Parameters:
    folder : 'T1 -> 'T2 -> 'State -> 'State - The function to update the state given the input elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.
    state : 'State - The initial state.

Returns: 'State The final state value.
Modifiers: inline
Type parameters: 'T1, 'T2, 'State

Applies a function to corresponding elements of two collections, threading an accumulator argument through the computation. The collections must have identical sizes. If the input function is f and the elements are i0...iN and j0...jN then computes f (... (f s i0 j0)...) iN jN.

folder : 'T1 -> 'T2 -> 'State -> 'State

The function to update the state given the input elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

state : 'State

The initial state.

Returns: 'State

The final state value.

NonEmptyList.forall predicate list

Full Usage: NonEmptyList.forall predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: bool True if all of the elements satisfy the predicate.
Modifiers: inline
Type parameters: 'T

Tests if all elements of the collection satisfy the given predicate.

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: bool

True if all of the elements satisfy the predicate.

NonEmptyList.forall2 predicate list1 list2

Full Usage: NonEmptyList.forall2 predicate list1 list2

Parameters:
    predicate : 'T1 -> 'T2 -> bool - The function to test the input elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Returns: bool True if all of the pairs of elements satisfy the predicate.
Modifiers: inline
Type parameters: 'T1, 'T2

Tests if all corresponding elements of the collection satisfy the given predicate pairwise.

predicate : 'T1 -> 'T2 -> bool

The function to test the input elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

Returns: bool

True if all of the pairs of elements satisfy the predicate.

ArgumentException Thrown when the input lists differ in length.

NonEmptyList.gather f source

Full Usage: NonEmptyList.gather f source

Parameters:
Returns: ^e
Modifiers: inline
Type parameters: 'T, ^ZipFunctor<'U>, ^a, ^b, 'c, 'd, ^e, 'f

Maps each element of the list to an action, evaluates these actions from left to right, pointwise, and/or in parallel then collect results.

f : 'T -> ^ZipFunctor<'U>
source : NonEmptyList<'T>
Returns: ^e

NonEmptyList.groupBy projection list

Full Usage: NonEmptyList.groupBy projection list

Parameters:
    projection : 'T -> 'U - A function that transforms an element of the list into a comparable key.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'U * NonEmptyList<'T>> The result list.
Modifiers: inline
Type parameters: 'T, 'U

Applies a key-generating function to each element of a list and yields a list of unique keys. Each unique key contains a list of all elements that match to this key.

projection : 'T -> 'U

A function that transforms an element of the list into a comparable key.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'U * NonEmptyList<'T>>

The result list.

NonEmptyList.head arg1

Full Usage: NonEmptyList.head arg1

Parameters:
Returns: 'a

Returns the first element of a new non empty list. You can also use property nel.Head.

arg0 : NonEmptyList<'a>
Returns: 'a

NonEmptyList.indexed list

Full Usage: NonEmptyList.indexed list

Parameters:
Returns: NonEmptyList<int * 'T> The result list.

Returns a list of each element in the list and its index.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<int * 'T>

The result list.

NonEmptyList.init count initializer

Full Usage: NonEmptyList.init count initializer

Parameters:
    count : int - The number of elements to initialize.
    initializer : int -> 'T - A function that produces an element from an index.

Returns: NonEmptyList<'T> The result list.

Creates a list by applying a function to each index.

count : int

The number of elements to initialize.

initializer : int -> 'T

A function that produces an element from an index.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when count is less than or equal to zero.

NonEmptyList.insertAt index value list

Full Usage: NonEmptyList.insertAt index value list

Parameters:
    index : int - The index at which to insert the element.
    value : 'T - The value to insert.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Inserts an element at the specified index.

index : int

The index at which to insert the element.

value : 'T

The value to insert.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.insertManyAt index values list

Full Usage: NonEmptyList.insertManyAt index values list

Parameters:
    index : int - The index at which to insert the elements.
    values : 'T seq - The values to insert.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Inserts multiple elements at the specified index.

index : int

The index at which to insert the elements.

values : 'T seq

The values to insert.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.item index list

Full Usage: NonEmptyList.item index list

Parameters:
    index : int - The index of the element to retrieve.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The element at the specified index.

Returns the element at the specified index.

index : int

The index of the element to retrieve.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The element at the specified index.

ArgumentException Thrown when index is out of range.

NonEmptyList.iter action list

Full Usage: NonEmptyList.iter action list

Parameters:
    action : 'T -> unit - The function to apply to each element.
    list : NonEmptyList<'T> - The input list.

Applies a function to each element of the list.

action : 'T -> unit

The function to apply to each element.

list : NonEmptyList<'T>

The input list.

NonEmptyList.iter2 action list1 list2

Full Usage: NonEmptyList.iter2 action list1 list2

Parameters:
    action : 'T1 -> 'T2 -> unit - The function to apply to each pair of elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Applies a function to each element of the two lists.

action : 'T1 -> 'T2 -> unit

The function to apply to each pair of elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

NonEmptyList.iteri action list

Full Usage: NonEmptyList.iteri action list

Parameters:
    action : int -> 'T -> unit - The function to apply to each element and its index.
    list : NonEmptyList<'T> - The input list.

Applies a function to each element of the list, passing the index of the element as the first argument to the function.

action : int -> 'T -> unit

The function to apply to each element and its index.

list : NonEmptyList<'T>

The input list.

NonEmptyList.iteri2 action list1 list2

Full Usage: NonEmptyList.iteri2 action list1 list2

Parameters:
    action : int -> 'T1 -> 'T2 -> unit - The function to apply to each pair of elements and their index.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Applies a function to each element of the two lists, passing the index of the elements as the first argument to the function.

action : int -> 'T1 -> 'T2 -> unit

The function to apply to each pair of elements and their index.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

NonEmptyList.last list

Full Usage: NonEmptyList.last list

Parameters:
Returns: 'T The last element of the list.

Returns the last element of the list.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The last element of the list.

NonEmptyList.length nel

Full Usage: NonEmptyList.length nel

Parameters:
Returns: int

Returns the length of a non empty list. You can also use property nel.Length.

nel : NonEmptyList<'a>
Returns: int

NonEmptyList.map f arg2

Full Usage: NonEmptyList.map f arg2

Parameters:
Returns: NonEmptyList<'b>

Build a new non empty list whose elements are the results of applying the given function to each of the elements of the non empty list.

f : 'a -> 'b
arg1 : NonEmptyList<'a>
Returns: NonEmptyList<'b>

NonEmptyList.map2 mapping list1 list2

Full Usage: NonEmptyList.map2 mapping list1 list2

Parameters:
    mapping : 'T1 -> 'T2 -> 'U - The function to apply to each pair of elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Returns: NonEmptyList<'U> The result list.

Applies a function to the corresponding elements of two lists, returning a list of the results.

mapping : 'T1 -> 'T2 -> 'U

The function to apply to each pair of elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

Returns: NonEmptyList<'U>

The result list.

NonEmptyList.map2Shortest f l1 l2

Full Usage: NonEmptyList.map2Shortest f l1 l2

Parameters:
Returns: NonEmptyList<'c>

Safely build a new non empty list whose elements are the results of applying the given function to each of the elements of the two non empty list pairwise.

f : 'a -> 'b -> 'c
l1 : NonEmptyList<'a>
l2 : NonEmptyList<'b>
Returns: NonEmptyList<'c>

NonEmptyList.map3 mapping list1 list2 list3

Full Usage: NonEmptyList.map3 mapping list1 list2 list3

Parameters:
    mapping : 'T1 -> 'T2 -> 'T3 -> 'U - The function to apply to each triplet of elements.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.
    list3 : NonEmptyList<'T3> - The third input list.

Returns: NonEmptyList<'U> The result list.

Applies a function to the corresponding elements of three lists, returning a list of the results.

mapping : 'T1 -> 'T2 -> 'T3 -> 'U

The function to apply to each triplet of elements.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

list3 : NonEmptyList<'T3>

The third input list.

Returns: NonEmptyList<'U>

The result list.

NonEmptyList.map3Shortest f l1 l2 l3

Full Usage: NonEmptyList.map3Shortest f l1 l2 l3

Parameters:
Returns: NonEmptyList<'d>

Safely build a new non empty list whose elements are the results of applying the given function to each of the elements of the three non empty list pointwise.

f : 'a -> 'b -> 'c -> 'd
l1 : NonEmptyList<'a>
l2 : NonEmptyList<'b>
l3 : NonEmptyList<'c>
Returns: NonEmptyList<'d>

NonEmptyList.mapFold mapping state list

Full Usage: NonEmptyList.mapFold mapping state list

Parameters:
    mapping : 'State -> 'T -> 'Result * 'State - The function to apply to each element and the accumulator.
    state : 'State - The initial state.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'Result> * 'State The result list and the final state.

Applies a function to each element of the list, threading an accumulator argument through the computation.

mapping : 'State -> 'T -> 'Result * 'State

The function to apply to each element and the accumulator.

state : 'State

The initial state.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'Result> * 'State

The result list and the final state.

NonEmptyList.mapFoldBack mapping list state

Full Usage: NonEmptyList.mapFoldBack mapping list state

Parameters:
    mapping : 'T -> 'State -> 'Result * 'State - The function to apply to each element and the accumulator.
    list : NonEmptyList<'T> - The input list.
    state : 'State - The initial state.

Returns: NonEmptyList<'Result> * 'State The result list and the final state.

Applies a function to each element of the list, threading an accumulator argument through the computation. The function is applied to the elements of the list in reverse order.

mapping : 'T -> 'State -> 'Result * 'State

The function to apply to each element and the accumulator.

list : NonEmptyList<'T>

The input list.

state : 'State

The initial state.

Returns: NonEmptyList<'Result> * 'State

The result list and the final state.

NonEmptyList.mapi f arg2

Full Usage: NonEmptyList.mapi f arg2

Parameters:
Returns: NonEmptyList<'b>

Build a new non empty list whose elements are the results of applying the given function with index to each of the elements of the non empty list.

f : int -> 'a -> 'b
arg1 : NonEmptyList<'a>
Returns: NonEmptyList<'b>

NonEmptyList.mapi2 mapping list1 list2

Full Usage: NonEmptyList.mapi2 mapping list1 list2

Parameters:
    mapping : int -> 'T1 -> 'T2 -> 'U - The function to apply to each pair of elements and their index.
    list1 : NonEmptyList<'T1> - The first input list.
    list2 : NonEmptyList<'T2> - The second input list.

Returns: NonEmptyList<'U> The result list.

Applies a function to each element of the two lists, passing the index of the elements as the first argument to the function.

mapping : int -> 'T1 -> 'T2 -> 'U

The function to apply to each pair of elements and their index.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

Returns: NonEmptyList<'U>

The result list.

NonEmptyList.max list

Full Usage: NonEmptyList.max list

Parameters:
Returns: 'T The maximum element.

Returns the greatest of all elements of the list, compared via Operators.max.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The maximum element.

NonEmptyList.maxBy projection list

Full Usage: NonEmptyList.maxBy projection list

Parameters:
    projection : 'T -> 'U - The function to transform the list elements into the type to be compared.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The maximum element.

Returns the greatest of all elements of the list, compared via Operators.max on the function result.

projection : 'T -> 'U

The function to transform the list elements into the type to be compared.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The maximum element.

NonEmptyList.min list

Full Usage: NonEmptyList.min list

Parameters:
Returns: 'T The minimum value.

Returns the lowest of all elements of the list, compared via Operators.min.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The minimum value.

NonEmptyList.minBy projection list

Full Usage: NonEmptyList.minBy projection list

Parameters:
    projection : 'T -> 'U - The function to transform list elements into the type to be compared.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The minimum value.

Returns the lowest of all elements of the list, compared via Operators.min on the function result

projection : 'T -> 'U

The function to transform list elements into the type to be compared.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The minimum value.

NonEmptyList.ofArray array

Full Usage: NonEmptyList.ofArray array

Parameters:
    array : 'a array - The input array.

Returns: NonEmptyList<'a> Non empty list containing the elements of the array.

Builds a non empty list from the given array.

Throws exception for empty array

array : 'a array

The input array.

Returns: NonEmptyList<'a>

Non empty list containing the elements of the array.

ArgumentException Thrown when the input array is empty.

NonEmptyList.ofList list

Full Usage: NonEmptyList.ofList list

Parameters:
    list : 'a list - The input list.

Returns: NonEmptyList<'a> Non empty list containing the elements of the list.

Builds a non empty list from the given list.

Throws exception for empty list

list : 'a list

The input list.

Returns: NonEmptyList<'a>

Non empty list containing the elements of the list.

ArgumentException Thrown when the input list is empty.

NonEmptyList.ofNonEmptySeq s

Full Usage: NonEmptyList.ofNonEmptySeq s

Parameters:
Returns: NonEmptyList<'a>
s : NonEmptySeq<'a>
Returns: NonEmptyList<'a>

NonEmptyList.ofSeq seq

Full Usage: NonEmptyList.ofSeq seq

Parameters:
    seq : 'a seq - The input list.

Returns: NonEmptyList<'a> Non empty list containing the elements of the list.

Builds a non empty list from the given sequence.

Throws exception for empty list

seq : 'a seq

The input list.

Returns: NonEmptyList<'a>

Non empty list containing the elements of the list.

ArgumentException Thrown when the input list is empty.

NonEmptyList.pairwise list

Full Usage: NonEmptyList.pairwise list

Parameters:
Returns: NonEmptyList<'T * 'T> The result list.

Returns a list of each pair of consecutive elements in the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T * 'T>

The result list.

NonEmptyList.partition predicate list

Full Usage: NonEmptyList.partition predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: 'T list * 'T list A tuple containing the two lists.

Splits the list into two lists, containing the elements for which the given function returns true and false respectively.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: 'T list * 'T list

A tuple containing the two lists.

NonEmptyList.permute permutation list

Full Usage: NonEmptyList.permute permutation list

Parameters:
    permutation : int -> int - A function to generate a permutation of the list indices.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Applies a function to each element of the list, returning a list of the results in a random order.

permutation : int -> int

A function to generate a permutation of the list indices.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.pick chooser list

Full Usage: NonEmptyList.pick chooser list

Parameters:
    chooser : 'T -> 'U option - A function to transform elements of the list into options.
    list : NonEmptyList<'T> - The input list.

Returns: 'U The first chosen element.

Returns the first element for which the given function returns Some. If no such element exists, raises KeyNotFoundException.

chooser : 'T -> 'U option

A function to transform elements of the list into options.

list : NonEmptyList<'T>

The input list.

Returns: 'U

The first chosen element.

KeyNotFoundException Thrown when no element is chosen.

NonEmptyList.range start stop

Full Usage: NonEmptyList.range start stop

Parameters:
    start : ^T
    stop : ^T

Returns: NonEmptyList<^T>
Modifiers: inline
Type parameters: ^T

Equivalent to [start..stop] on regular lists.

start : ^T
stop : ^T
Returns: NonEmptyList<^T>

NonEmptyList.reduce reduction list

Full Usage: NonEmptyList.reduce reduction list

Parameters:
    reduction : 'T -> 'T -> 'T - The function to reduce two list elements to a single element.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The final reduced value.

Applies a function to each element of the list, threading an accumulator argument through the computation. Apply the function to the first two elements of the list. Then feed this result into the function along with the third element and so on. Return the final result. If the input function is f and the elements are i0...iN then computes f (... (f i0 i1) i2 ...) iN.

reduction : 'T -> 'T -> 'T

The function to reduce two list elements to a single element.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The final reduced value.

NonEmptyList.reduceBack reduction list

Full Usage: NonEmptyList.reduceBack reduction list

Parameters:
    reduction : 'T -> 'T -> 'T - A function that takes in the next-to-last element of the list and the current accumulated result to produce the next accumulated result.
    list : NonEmptyList<'T> - The input list.

Returns: 'T The final result of the reductions.

Applies a function to each element of the list, starting from the end, 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)).

reduction : 'T -> 'T -> 'T

A function that takes in the next-to-last element of the list and the current accumulated result to produce the next accumulated result.

list : NonEmptyList<'T>

The input list.

Returns: 'T

The final result of the reductions.

NonEmptyList.removeAt index list

Full Usage: NonEmptyList.removeAt index list

Parameters:
    index : int - The index of the element to remove.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The resulting list.

Removes the element at the specified index.

index : int

The index of the element to remove.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The resulting list.

ArgumentException Thrown when removing the item results in an empty list.

NonEmptyList.removeManyAt index count list

Full Usage: NonEmptyList.removeManyAt index count list

Parameters:
    index : int - The index at which to start removing elements.
    count : int - The number of elements to remove.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Removes multiple elements starting at the specified index.

index : int

The index at which to start removing elements.

count : int

The number of elements to remove.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when removing the items results in an empty list.

NonEmptyList.replicate count value

Full Usage: NonEmptyList.replicate count value

Parameters:
    count : int - The number of elements.
    value : 'T - The value to replicate.

Returns: NonEmptyList<'T> The result list.

Creates a list that contains one repeated value.

count : int

The number of elements.

value : 'T

The value to replicate.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.rev list

Full Usage: NonEmptyList.rev list

Parameters:
Returns: NonEmptyList<'T> The reversed list.

Reverses the elements of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The reversed list.

NonEmptyList.scan folder state list

Full Usage: NonEmptyList.scan folder state list

Parameters:
    folder : 'State -> 'T -> 'State - A function that updates the state with each element.
    state : 'State - The initial state.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'State> The list of state values.

Applies a function to each element of the list, threading an accumulator argument through the computation.

folder : 'State -> 'T -> 'State

A function that updates the state with each element.

state : 'State

The initial state.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'State>

The list of state values.

NonEmptyList.scanBack folder list state

Full Usage: NonEmptyList.scanBack folder list state

Parameters:
    folder : 'T -> 'State -> 'State - A function that updates the state with each element.
    list : NonEmptyList<'T> - The input list.
    state : 'State - The initial state.

Returns: NonEmptyList<'State> The list of state values.

Applies a function to each element of the list, threading an accumulator argument through the computation. The function is applied to the elements of the list in reverse order.

folder : 'T -> 'State -> 'State

A function that updates the state with each element.

list : NonEmptyList<'T>

The input list.

state : 'State

The initial state.

Returns: NonEmptyList<'State>

The list of state values.

NonEmptyList.sequence source

Full Usage: NonEmptyList.sequence source

Parameters:
Returns: ^Functor>
Modifiers: inline
Type parameters: ^Functor<'T>, ^a, 'b, ^c, 'd, ^Functor<NonEmptyList<'T>>, 'e

Evaluates each action in the list from left to right and collect the results.

source : NonEmptyList<^Functor<'T>>
Returns: ^Functor>

NonEmptyList.singleton x

Full Usage: NonEmptyList.singleton x

Parameters:
    x : 'a

Returns: NonEmptyList<'a>

Builds a non empty list with a single element.

x : 'a
Returns: NonEmptyList<'a>

NonEmptyList.skip count list

Full Usage: NonEmptyList.skip count list

Parameters:
    count : int - The number of elements to skip.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Returns a list that skips the first N elements of the list.

count : int

The number of elements to skip.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when resulting list is empty.

NonEmptyList.skipWhile predicate list

Full Usage: NonEmptyList.skipWhile predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Returns a list that skips elements while the predicate is true.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when resulting list is empty.

NonEmptyList.sort list

Full Usage: NonEmptyList.sort list

Parameters:
Returns: NonEmptyList<'T> The sorted list.

Sorts the elements of the list in ascending order.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The sorted list.

NonEmptyList.sortBy projection list

Full Usage: NonEmptyList.sortBy projection list

Parameters:
    projection : 'T -> 'Key - A function to transform the list elements before comparison.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The sorted list.

Sorts the elements of the list in ascending order, using the given projection for comparison.

projection : 'T -> 'Key

A function to transform the list elements before comparison.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The sorted list.

NonEmptyList.sortByDescending projection list

Full Usage: NonEmptyList.sortByDescending projection list

Parameters:
    projection : 'T -> 'Key - A function to transform the list elements before comparison.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The sorted list.

Sorts the elements of the list in descending order, using the given projection for comparison.

projection : 'T -> 'Key

A function to transform the list elements before comparison.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The sorted list.

NonEmptyList.sortDescending list

Full Usage: NonEmptyList.sortDescending list

Parameters:
Returns: NonEmptyList<'T> The sorted list.

Sorts the elements of the list in descending order.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The sorted list.

NonEmptyList.sortWith comparer list

Full Usage: NonEmptyList.sortWith comparer list

Parameters:
    comparer : 'T -> 'T -> int - A function to compare pairs of elements.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The sorted list.

Sorts the elements of the list using the given comparison function.

comparer : 'T -> 'T -> int

A function to compare pairs of elements.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The sorted list.

NonEmptyList.splitAt index list

Full Usage: NonEmptyList.splitAt index list

Parameters:
    index : int - The index at which to split the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> * NonEmptyList<'T> A tuple containing the two lists.

Splits the list at the specified index.

index : int

The index at which to split the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> * NonEmptyList<'T>

A tuple containing the two lists.

InvalidOperationException Thrown when the index is 0, equal to the size of the list, or is larger than the list.

NonEmptyList.splitInto count list

Full Usage: NonEmptyList.splitInto count list

Parameters:
    count : int - The number of lists to create.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<NonEmptyList<'T>> A list of lists.

Splits the list into the specified number of lists.

count : int

The number of lists to create.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<NonEmptyList<'T>>

A list of lists.

NonEmptyList.sum list

Full Usage: NonEmptyList.sum list

Parameters:
    list : ^a seq - The input list.

Returns: ^a The sum of the elements.
Modifiers: inline
Type parameters: ^a

Computes the sum of the elements of the list.

list : ^a seq

The input list.

Returns: ^a

The sum of the elements.

NonEmptyList.sumBy projection list

Full Usage: NonEmptyList.sumBy projection list

Parameters:
    projection : 'a -> ^b - A function to transform the list elements before summing.
    list : 'a seq - The input list.

Returns: ^b The sum of the transformed elements.
Modifiers: inline
Type parameters: 'a, ^b

Computes the sum of the elements of the list, using the given projection.

projection : 'a -> ^b

A function to transform the list elements before summing.

list : 'a seq

The input list.

Returns: ^b

The sum of the transformed elements.

NonEmptyList.tail list

Full Usage: NonEmptyList.tail list

Parameters:
Returns: NonEmptyList<'a>

Returns a new NonEmptyList of the elements trailing the first element.

Throws exception for empty tail

list : NonEmptyList<'a>
Returns: NonEmptyList<'a>
ArgumentException Thrown when the tail is empty.

NonEmptyList.tails s

Full Usage: NonEmptyList.tails s

Parameters:
Returns: NonEmptyList<NonEmptyList<'a>>
s : NonEmptyList<'a>
Returns: NonEmptyList<NonEmptyList<'a>>

NonEmptyList.take count list

Full Usage: NonEmptyList.take count list

Parameters:
    count : int - The number of elements to take.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Returns a list that contains the first N elements of the list.

count : int

The number of elements to take.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when the count is less than or equal to zero.

NonEmptyList.takeWhile predicate list

Full Usage: NonEmptyList.takeWhile predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Returns a list that contains the elements of the list while the predicate is true.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

ArgumentException Thrown when resulting list is empty.

NonEmptyList.toArray nel

Full Usage: NonEmptyList.toArray nel

Parameters:
Returns: 'a array

Builds an array from the given non empty list.

nel : NonEmptyList<'a>
Returns: 'a array

NonEmptyList.toList arg1

Full Usage: NonEmptyList.toList arg1

Parameters:
Returns: 'a list

Builds a list from the given non empty list.

arg0 : NonEmptyList<'a>
Returns: 'a list

NonEmptyList.toNonEmptySeq list

Full Usage: NonEmptyList.toNonEmptySeq list

Parameters:
Returns: NonEmptySeq<'a>
list : NonEmptyList<'a>
Returns: NonEmptySeq<'a>

NonEmptyList.toSeq arg1

Full Usage: NonEmptyList.toSeq arg1

Parameters:
Returns: 'a seq

Builds a sequence from the given non empty list.

arg0 : NonEmptyList<'a>
Returns: 'a seq

NonEmptyList.transpose source

Full Usage: NonEmptyList.transpose source

Parameters:
Returns: ^Functor>
Modifiers: inline
Type parameters: ^ZipFunctor<'T>, ^a, 'b, ^c, 'd, ^Functor<NonEmptyList<'T>>, 'e

Evaluates each action in the list from left to right, pointwise, and/or in parallel then collect results.

source : NonEmptyList<^ZipFunctor<'T>>
Returns: ^Functor>

NonEmptyList.traverse f source

Full Usage: NonEmptyList.traverse f source

Parameters:
Returns: ^Functor>
Modifiers: inline
Type parameters: 'T, ^Functor<'U>, ^a, 'b, ^Functor<'List<'U>>, 'c, ^Functor<NonEmptyList<'U>>, 'd

Maps each element of the list to an action, evaluates these actions from left to right and collect the results.

f : 'T -> ^Functor<'U>
source : NonEmptyList<'T>
Returns: ^Functor>

NonEmptyList.truncate count list

Full Usage: NonEmptyList.truncate count list

Parameters:
    count : int - The maximum number of elements to include in the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The truncated list.

Truncates the list to the specified length.

count : int

The maximum number of elements to include in the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The truncated list.

NonEmptyList.tryChoose chooser list

Full Usage: NonEmptyList.tryChoose chooser list

Parameters:
    chooser : 'T -> 'a option - The function to be applied to the list elements.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'a> option The resulting list comprising the values v where the chooser function returned Some(x).
Modifiers: inline
Type parameters: 'T, 'a

Applies a function to each element in a list and then returns a list of values v where the applied function returned Some(v).

chooser : 'T -> 'a option

The function to be applied to the list elements.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'a> option

The resulting list comprising the values v where the chooser function returned Some(x).

NonEmptyList.tryCollect mapping list

Full Usage: NonEmptyList.tryCollect mapping list

Parameters:
    mapping : 'T -> 'a - The function to transform each input element into a sublist to be concatenated.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'b> option The concatenation of the transformed sublists.
Modifiers: inline
Type parameters: 'T, 'a, 'b

For each element of the list, applies the given function. Concatenates all the results and returns the combined list.

mapping : 'T -> 'a

The function to transform each input element into a sublist to be concatenated.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'b> option

The concatenation of the transformed sublists.

NonEmptyList.tryConcat lists

Full Usage: NonEmptyList.tryConcat lists

Parameters:
Returns: NonEmptyList<'T> option The resulting concatenated list or None.
Modifiers: inline
Type parameters: 'a, 'T

Returns a new list that contains the elements of each of the lists in order. Returns None if all of the inner lists are empty.

lists : NonEmptyList<'a>

The input list of lists.

Returns: NonEmptyList<'T> option

The resulting concatenated list or None.

NonEmptyList.tryExactlyOne list

Full Usage: NonEmptyList.tryExactlyOne list

Parameters:
Returns: 'T option The only element of the list, or None.

Returns the only element of the list, or None if the list does not contain exactly one element.

list : NonEmptyList<'T>

The input list.

Returns: 'T option

The only element of the list, or None.

NonEmptyList.tryFilter predicate list

Full Usage: NonEmptyList.tryFilter predicate list

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option A list containing only the elements that satisfy the predicate.
Modifiers: inline
Type parameters: 'T

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

predicate : 'T -> bool

The function to test the input elements.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

A list containing only the elements that satisfy the predicate.

NonEmptyList.tryFind predicate list

Full Usage: NonEmptyList.tryFind predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: 'T option The first element for which the predicate returns true, or None.

Returns the first element for which the given function returns true, or None if no such element exists.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: 'T option

The first element for which the predicate returns true, or None.

NonEmptyList.tryFindBack predicate list

Full Usage: NonEmptyList.tryFindBack predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: 'T option The last element for which the predicate returns true, or None.

Returns the last element for which the given function returns true, or None if no such element exists.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: 'T option

The last element for which the predicate returns true, or None.

NonEmptyList.tryFindIndex predicate list

Full Usage: NonEmptyList.tryFindIndex predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: int option The index of the first element for which the predicate returns true, or None.

Returns the index of the first element for which the given function returns true, or None if no such element exists.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: int option

The index of the first element for which the predicate returns true, or None.

NonEmptyList.tryFindIndexBack predicate list

Full Usage: NonEmptyList.tryFindIndexBack predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: int option The index of the last element for which the predicate returns true, or None.

Returns the index of the last element for which the given function returns true, or None if no such element exists.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: int option

The index of the last element for which the predicate returns true, or None.

NonEmptyList.tryItem index list

Full Usage: NonEmptyList.tryItem index list

Parameters:
    index : int - The index of the element to retrieve.
    list : NonEmptyList<'T> - The input list.

Returns: 'T option The element at the specified index, or None.

Returns the element at the specified index, or None if the index is out of range.

index : int

The index of the element to retrieve.

list : NonEmptyList<'T>

The input list.

Returns: 'T option

The element at the specified index, or None.

NonEmptyList.tryLast list

Full Usage: NonEmptyList.tryLast list

Parameters:
Returns: 'T option The last element of the list, or None.

Returns the last element of the list, or None if the list is empty.

list : NonEmptyList<'T>

The input list.

Returns: 'T option

The last element of the list, or None.

NonEmptyList.tryOfArray array

Full Usage: NonEmptyList.tryOfArray array

Parameters:
    array : 'a array - The input array.

Returns: NonEmptyList<'a> option Non empty list containing the elements of the array. Returns None if no the input list is empty.

Attempts to build a non empty list from the given array.

array : 'a array

The input array.

Returns: NonEmptyList<'a> option

Non empty list containing the elements of the array. Returns None if no the input list is empty.

NonEmptyList.tryOfList list

Full Usage: NonEmptyList.tryOfList list

Parameters:
    list : 'a list - The input list.

Returns: NonEmptyList<'a> option Non empty list containing the elements of the list. Returns None if no the input list is empty.

Attempts to build a non empty list from the given list.

list : 'a list

The input list.

Returns: NonEmptyList<'a> option

Non empty list containing the elements of the list. Returns None if no the input list is empty.

NonEmptyList.tryOfSeq seq

Full Usage: NonEmptyList.tryOfSeq seq

Parameters:
    seq : 'a seq - The input list.

Returns: NonEmptyList<'a> option Non empty list containing the elements of the list. Returns None if no the input list is empty.

Attempts to build a non empty list from the given sequence.

seq : 'a seq

The input list.

Returns: NonEmptyList<'a> option

Non empty list containing the elements of the list. Returns None if no the input list is empty.

NonEmptyList.tryPick chooser list

Full Usage: NonEmptyList.tryPick chooser list

Parameters:
    chooser : 'T -> 'U option - A function to transform elements of the list into options.
    list : NonEmptyList<'T> - The input list.

Returns: 'U option The first chosen element, or None.

Returns the first element for which the given function returns Some, or None if no such element exists.

chooser : 'T -> 'U option

A function to transform elements of the list into options.

list : NonEmptyList<'T>

The input list.

Returns: 'U option

The first chosen element, or None.

NonEmptyList.tryRemoveAt index list

Full Usage: NonEmptyList.tryRemoveAt index list

Parameters:
    index : int - The index of the element to remove.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The resulting list.

Removes the element at the specified index.

index : int

The index of the element to remove.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The resulting list.

NonEmptyList.tryRemoveManyAt index count list

Full Usage: NonEmptyList.tryRemoveManyAt index count list

Parameters:
    index : int - The index at which to start removing elements.
    count : int - The number of elements to remove.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The result list.

Removes multiple elements starting at the specified index.

index : int

The index at which to start removing elements.

count : int

The number of elements to remove.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The result list.

NonEmptyList.trySkip count list

Full Usage: NonEmptyList.trySkip count list

Parameters:
    count : int - The number of elements to skip.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The result list.

Returns a list that skips the first N elements of the list.

count : int

The number of elements to skip.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The result list.

NonEmptyList.trySkipWhile predicate list

Full Usage: NonEmptyList.trySkipWhile predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The result list.

Returns a list that skips elements while the predicate is true.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The result list.

NonEmptyList.tryTail arg1

Full Usage: NonEmptyList.tryTail arg1

Parameters:
Returns: NonEmptyList<'a> option

Returns a new NonEmptyList of the elements trailing the first element or None.

arg0 : NonEmptyList<'a>
Returns: NonEmptyList<'a> option

NonEmptyList.tryTake count list

Full Usage: NonEmptyList.tryTake count list

Parameters:
    count : int - The number of elements to take.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The result list.

Returns a list that contains the first N elements of the list.

count : int

The number of elements to take.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The result list.

NonEmptyList.tryTakeWhile predicate list

Full Usage: NonEmptyList.tryTakeWhile predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The result list.

Returns a list that contains the elements of the list while the predicate is true.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The result list.

NonEmptyList.tryTruncate count list

Full Usage: NonEmptyList.tryTruncate count list

Parameters:
    count : int - The maximum number of elements to include in the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> option The truncated list.

Truncates the list to the specified length.

count : int

The maximum number of elements to include in the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T> option

The truncated list.

NonEmptyList.uncons list

Full Usage: NonEmptyList.uncons list

Parameters:
Returns: 'a * NonEmptyList<'a> A tuple with the head and the tail of the original list.

Splits the list in head and tail.

list : NonEmptyList<'a>

The input list.

Returns: 'a * NonEmptyList<'a>

A tuple with the head and the tail of the original list.

ArgumentException Thrown when the input list tail is empty.

NonEmptyList.unconsAsList list

Full Usage: NonEmptyList.unconsAsList list

Parameters:
Returns: 'a * 'a list A tuple with the head and the tail of the original list.

Splits the NonEmptyList in head and tail.

list : NonEmptyList<'a>

The input (non empty) list.

Returns: 'a * 'a list

A tuple with the head and the tail of the original list.

NonEmptyList.unfold generator state

Full Usage: NonEmptyList.unfold generator state

Parameters:
    generator : 'State -> ('T * 'State) option - A function that takes the current state and returns an option tuple of the next element and the next state.
    state : 'State - The initial state.

Returns: NonEmptyList<'T> The result list.

Generates a list by repeatedly applying a function to a state.

generator : 'State -> ('T * 'State) option

A function that takes the current state and returns an option tuple of the next element and the next state.

state : 'State

The initial state.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.unzip list

Full Usage: NonEmptyList.unzip list

Parameters:
Returns: NonEmptyList<'T1> * NonEmptyList<'T2> Two lists of split elements.

Splits a list of pairs into two lists.

list : NonEmptyList<'T1 * 'T2>

The input list.

Returns: NonEmptyList<'T1> * NonEmptyList<'T2>

Two lists of split elements.

NonEmptyList.unzip3 list

Full Usage: NonEmptyList.unzip3 list

Parameters:
Returns: NonEmptyList<'T1> * NonEmptyList<'T2> * NonEmptyList<'T3> A tuple containing the three lists.

Splits a list of triples into three lists.

list : NonEmptyList<'T1 * 'T2 * 'T3>

The input list.

Returns: NonEmptyList<'T1> * NonEmptyList<'T2> * NonEmptyList<'T3>

A tuple containing the three lists.

NonEmptyList.updateAt index value list

Full Usage: NonEmptyList.updateAt index value list

Parameters:
    index : int - The index of the element to update.
    value : 'T - The new value.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Updates the element at the specified index.

index : int

The index of the element to update.

value : 'T

The new value.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.where predicate list

Full Usage: NonEmptyList.where predicate list

Parameters:
    predicate : 'T -> bool - A function to test each element of the list.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<'T> The result list.

Returns a list that contains the elements of the list for which the given function returns true.

predicate : 'T -> bool

A function to test each element of the list.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<'T>

The result list.

NonEmptyList.windowed windowSize list

Full Usage: NonEmptyList.windowed windowSize list

Parameters:
    windowSize : int - The number of elements in each window.
    list : NonEmptyList<'T> - The input list.

Returns: NonEmptyList<NonEmptyList<'T>> The list of windows.

Returns a list of sliding windows containing elements drawn from the list.

windowSize : int

The number of elements in each window.

list : NonEmptyList<'T>

The input list.

Returns: NonEmptyList<NonEmptyList<'T>>

The list of windows.

NonEmptyList.zip list1 list2

Full Usage: NonEmptyList.zip list1 list2

Parameters:
Returns: NonEmptyList<'T * 'U> A single list containing pairs of matching elements from the input lists.

Combines the two lists into a list of pairs. The two lists must have equal lengths.

list1 : NonEmptyList<'T>

The first input list.

list2 : NonEmptyList<'U>

The second input list.

Returns: NonEmptyList<'T * 'U>

A single list containing pairs of matching elements from the input lists.

NonEmptyList.zip3 list1 list2 list3

Full Usage: NonEmptyList.zip3 list1 list2 list3

Parameters:
Returns: NonEmptyList<'T1 * 'T2 * 'T3> The list of triples.

Combines the elements of three lists into a list of triples.

list1 : NonEmptyList<'T1>

The first input list.

list2 : NonEmptyList<'T2>

The second input list.

list3 : NonEmptyList<'T3>

The third input list.

Returns: NonEmptyList<'T1 * 'T2 * 'T3>

The list of triples.

NonEmptyList.zipShortest list1 list2

Full Usage: NonEmptyList.zipShortest list1 list2

Parameters:
Returns: NonEmptyList<'T * 'U> List with corresponding pairs of input lists.

Zip safely two lists. If one list is shorter, excess elements are discarded from the right end of the longer list.

list1 : NonEmptyList<'T>

First input list.

list2 : NonEmptyList<'U>

Second input list.

Returns: NonEmptyList<'T * 'U>

List with corresponding pairs of input lists.