FSharpPlus


NonEmptySeq Module

Functions and values

Function or value Description

starting ..| ending

Full Usage: starting ..| ending

Parameters:
    starting : int
    ending : int

Returns: NonEmptySeq<int>

Creates a NonEmptySeq range, containing at least the last element of the range

starting : int
ending : int
Returns: NonEmptySeq<int>

starting |.. ending

Full Usage: starting |.. ending

Parameters:
    starting : int
    ending : int

Returns: NonEmptySeq<int>

Creates a NonEmptySeq range, containing at least the first element of the range

starting : int
ending : int
Returns: NonEmptySeq<int>

allPairs source1 source2

Full Usage: allPairs source1 source2

Parameters:
Returns: NonEmptySeq<'a * 'b> The result sequence.

Returns a new sequence that contains all pairings of elements from the first and second sequences.

source1 : NonEmptySeq<'a>

The first sequence.

source2 : NonEmptySeq<'b>

The second sequence.

Returns: NonEmptySeq<'a * 'b>

The result sequence.

append source1 source2

Full Usage: append source1 source2

Parameters:
Returns: NonEmptySeq<'b> The result sequence.

Wraps the two given enumerations as a single concatenated enumeration.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

source1 : NonEmptySeq<'b>

The first sequence.

source2 : NonEmptySeq<'b>

The second sequence.

Returns: NonEmptySeq<'b>

The result sequence.

appendSeq source seq

Full Usage: appendSeq source seq

Parameters:
Returns: NonEmptySeq<'a>
source : NonEmptySeq<'a>
seq : 'a seq
Returns: NonEmptySeq<'a>

appendSeqBack seq source

Full Usage: appendSeqBack seq source

Parameters:
Returns: NonEmptySeq<'a>
seq : 'a seq
source : NonEmptySeq<'a>
Returns: NonEmptySeq<'a>

apply f x

Full Usage: apply f x

Parameters:
Returns: NonEmptySeq<'b>
f : NonEmptySeq<('a -> 'b)>
x : NonEmptySeq<'a>
Returns: NonEmptySeq<'b>

bind mapping source

Full Usage: bind mapping source

Parameters:
    mapping : 'T -> NonEmptySeq<'U> - A function to transform elements of the input NonEmptySequence into the NonEmptySequences that will then be concatenated.
    source : NonEmptySeq<'T> - The input NonEmptySequence.

Returns: NonEmptySeq<'U> The result NonEmptySequence.

Applies the given function to each element of the NonEmptySequence and concatenates all the results.

Remember NonEmptySequence is lazy, effects are delayed until it is enumerated.This is the same as Seq.collect but the type of the mapping function is not flexible.

mapping : 'T -> NonEmptySeq<'U>

A function to transform elements of the input NonEmptySequence into the NonEmptySequences that will then be concatenated.

source : NonEmptySeq<'T>

The input NonEmptySequence.

Returns: NonEmptySeq<'U>

The result NonEmptySequence.

ArgumentNullException Thrown when the input NonEmptySequence is null.

cache source

Full Usage: cache source

Parameters:
Returns: NonEmptySeq<'a> The result sequence.

Returns a sequence that corresponds to a cached version of the input sequence. This result sequence will have the same elements as the input sequence. The result can be enumerated multiple times. The input sequence will be enumerated at most once and only as far as is necessary. Caching a sequence is typically useful when repeatedly evaluating items in the original sequence is computationally expensive or if iterating the sequence causes side-effects that the user does not want to be repeated multiple times. Enumeration of the result sequence is thread safe in the sense that multiple independent IEnumerator values may be used simultaneously from different threads (accesses to the internal lookaside table are thread safe). Each individual IEnumerator is not typically thread safe and should not be accessed concurrently.

Once enumeration of the input sequence has started, it's enumerator will be kept live by this object until the enumeration has completed. At that point, the enumerator will be disposed. The enumerator may be disposed and underlying cache storage released by converting the returned sequence object to type IDisposable, and calling the Dispose method on this object. The sequence object may then be re-enumerated and a fresh enumerator will be used.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

collect mapping source

Full Usage: collect mapping source

Parameters:
    mapping : 'a -> '#NonEmptySeq<'b> - A function to transform elements of the input sequence into the sequences that will then be concatenated.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'b> The result sequence.

Applies the given function to each element of the sequence and concatenates all the results.

Remember sequence is lazy, effects are delayed until it is enumerated.

mapping : 'a -> '#NonEmptySeq<'b>

A function to transform elements of the input sequence into the sequences that will then be concatenated.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'b>

The result sequence.

concat sources

Full Usage: concat sources

Parameters:
    sources : NonEmptySeq<'#NonEmptySeq<'a>> - The input enumeration-of-enumerations.

Returns: NonEmptySeq<'a> The result sequence.

Combines the given enumeration-of-enumerations as a single concatenated enumeration.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

sources : NonEmptySeq<'#NonEmptySeq<'a>>

The input enumeration-of-enumerations.

Returns: NonEmptySeq<'a>

The result sequence.

create x xs

Full Usage: create x xs

Parameters:
    x : 'a
    xs : 'a seq

Returns: NonEmptySeq<'a>

Builds a non empty sequence.

x : 'a
xs : 'a seq
Returns: NonEmptySeq<'a>

delay generator

Full Usage: delay generator

Parameters:
    generator : unit -> NonEmptySeq<'a> - The generating function for the sequence.

Returns: NonEmptySeq<'a>

Returns a sequence that is built from the given delayed specification of a sequence.

The input function is evaluated each time an IEnumerator for the sequence is requested.

generator : unit -> NonEmptySeq<'a>

The generating function for the sequence.

Returns: NonEmptySeq<'a>

distinct source

Full Usage: distinct source

Parameters:
Returns: NonEmptySeq<'T> The resulting sequence without duplicates.

Returns a sequence 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 sequence then the later occurrences are discarded.

source : NonEmptySeq<'T>

The input sequence.

Returns: NonEmptySeq<'T>

The resulting sequence without duplicates.

head source

Full Usage: head source

Parameters:
Returns: 'a The first element of the sequence.

Returns the first element of the sequence.

source : NonEmptySeq<'a>

The input sequence.

Returns: 'a

The first element of the sequence.

indexed source

Full Usage: indexed source

Parameters:
Returns: NonEmptySeq<int * 'a> The result sequence.

Builds a new collection whose elements are the corresponding elements of the input collection paired with the integer index (from 0) of each element.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<int * 'a>

The result sequence.

initInfinite initializer

Full Usage: initInfinite initializer

Parameters:
    initializer : int -> 'b - A function that generates an item in the sequence from a given index.

Returns: NonEmptySeq<'b> The result sequence.

Generates a new sequence which, when iterated, will return successive elements by calling the given function. The results of calling the function will not be saved, that is the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. Iteration can continue up to Int32.MaxValue.

initializer : int -> 'b

A function that generates an item in the sequence from a given index.

Returns: NonEmptySeq<'b>

The result sequence.

lift2 f x1 x2

Full Usage: lift2 f x1 x2

Parameters:
Returns: NonEmptySeq<'f>
f : 'd -> 'e -> 'f
x1 : NonEmptySeq<'d>
x2 : NonEmptySeq<'e>
Returns: NonEmptySeq<'f>

lift3 f x1 x2 x3

Full Usage: lift3 f x1 x2 x3

Parameters:
    f : 'e -> 'f -> 'g -> 'h - Mapping function taking three element combination as input.
    x1 : NonEmptySeq<'g> - First NonEmptySeq.
    x2 : NonEmptySeq<'e> - Second NonEmptySeq.
    x3 : NonEmptySeq<'f> - Third NonEmptySeq.

Returns: NonEmptySeq<'h> NonEmptySeq with values returned from mapping function.

Combines values from three NonEmptySeq and calls a mapping function on this combination.

f : 'e -> 'f -> 'g -> 'h

Mapping function taking three element combination as input.

x1 : NonEmptySeq<'g>

First NonEmptySeq.

x2 : NonEmptySeq<'e>

Second NonEmptySeq.

x3 : NonEmptySeq<'f>

Third NonEmptySeq.

Returns: NonEmptySeq<'h>

NonEmptySeq with values returned from mapping function.

map mapping source

Full Usage: map mapping source

Parameters:
    mapping : 'a -> 'b - A function to transform items from the input sequence.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'b> The result sequence.

Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The given function will be applied as elements are demanded using the MoveNext method on enumerators retrieved from the object.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

mapping : 'a -> 'b

A function to transform items from the input sequence.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'b>

The result sequence.

map2 mapping source1 source2

Full Usage: map2 mapping source1 source2

Parameters:
    mapping : 'b -> 'c -> 'd - A function to transform pairs of items from the input sequences.
    source1 : NonEmptySeq<'b> - The first input sequence.
    source2 : NonEmptySeq<'c> - The second input sequence.

Returns: NonEmptySeq<'d> The result sequence.

Builds a new collection whose elements are the results of applying the given function to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than the other then the remaining elements of the longer sequence are ignored.

mapping : 'b -> 'c -> 'd

A function to transform pairs of items from the input sequences.

source1 : NonEmptySeq<'b>

The first input sequence.

source2 : NonEmptySeq<'c>

The second input sequence.

Returns: NonEmptySeq<'d>

The result sequence.

map3 mapping source1 source2 source3

Full Usage: map3 mapping source1 source2 source3

Parameters:
    mapping : 'e -> 'f -> 'g -> 'h - The function to transform triples of elements from the input sequences.
    source1 : NonEmptySeq<'e> - The first input sequence.
    source2 : NonEmptySeq<'f> - The second input sequence.
    source3 : NonEmptySeq<'g> - The third input sequence.

Returns: NonEmptySeq<'h> The result sequence.

Builds a new collection whose elements are the results of applying the given function to the corresponding triples of elements from the three sequences. If one input sequence if shorter than the others then the remaining elements of the longer sequences are ignored.

mapping : 'e -> 'f -> 'g -> 'h

The function to transform triples of elements from the input sequences.

source1 : NonEmptySeq<'e>

The first input sequence.

source2 : NonEmptySeq<'f>

The second input sequence.

source3 : NonEmptySeq<'g>

The third input sequence.

Returns: NonEmptySeq<'h>

The result sequence.

mapFold mapping state source

Full Usage: mapFold mapping state source

Parameters:
    mapping : 'State -> 'T -> 'Result * 'State - The function to transform elements from the input collection and accumulate the final value.
    state : 'State - The initial state.
    source : NonEmptySeq<'T> - The input collection.

Returns: NonEmptySeq<'Result> * 'State The collection of transformed elements, and the final accumulated value.

Combines map and fold. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function is also used to accumulate a final value.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.This function consumes the whole input sequence before yielding the first element of the result sequence.

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

The function to transform elements from the input collection and accumulate the final value.

state : 'State

The initial state.

source : NonEmptySeq<'T>

The input collection.

Returns: NonEmptySeq<'Result> * 'State

The collection of transformed elements, and the final accumulated value.

mapFoldBack mapping source state

Full Usage: mapFoldBack mapping source state

Parameters:
    mapping : 'T -> 'State -> 'Result * 'State - The function to transform elements from the input collection and accumulate the final value.
    source : NonEmptySeq<'T> - The input collection.
    state : 'State - The initial state.

Returns: NonEmptySeq<'Result> * 'State The collection of transformed elements, and the final accumulated value.

Combines map and foldBack. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function is also used to accumulate a final value.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.This function consumes the whole input sequence before yielding the first element of the result sequence.

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

The function to transform elements from the input collection and accumulate the final value.

source : NonEmptySeq<'T>

The input collection.

state : 'State

The initial state.

Returns: NonEmptySeq<'Result> * 'State

The collection of transformed elements, and the final accumulated value.

mapi mapping source

Full Usage: mapi mapping source

Parameters:
    mapping : int -> 'a -> 'b - A function to transform items from the input sequence that also supplies the current index.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'b> The result sequence.

Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The integer index passed to the function indicates the index (from 0) of element being transformed.

mapping : int -> 'a -> 'b

A function to transform items from the input sequence that also supplies the current index.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'b>

The result sequence.

mapi2 mapping source1 source2

Full Usage: mapi2 mapping source1 source2

Parameters:
    mapping : int -> 'a -> 'b -> 'c - A function to transform pairs of items from the input sequences that also supplies the current index.
    source1 : NonEmptySeq<'a> - The first input sequence.
    source2 : NonEmptySeq<'b> - The second input sequence.

Returns: NonEmptySeq<'c> The result sequence.

Builds a new collection whose elements are the results of applying the given function to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than the other then the remaining elements of the longer sequence are ignored. The integer index passed to the function indicates the index (from 0) of element being transformed.

mapping : int -> 'a -> 'b -> 'c

A function to transform pairs of items from the input sequences that also supplies the current index.

source1 : NonEmptySeq<'a>

The first input sequence.

source2 : NonEmptySeq<'b>

The second input sequence.

Returns: NonEmptySeq<'c>

The result sequence.

ofArray array

Full Usage: ofArray array

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

Returns: NonEmptySeq<'a> Non empty sequence containing the elements of the array.

Builds a non empty sequence from the given array.

Throws exception for empty array

array : 'a[]

The input array.

Returns: NonEmptySeq<'a>

Non empty sequence containing the elements of the array.

ArgumentException Thrown when the input array is empty.

ofList list

Full Usage: ofList list

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

Returns: NonEmptySeq<'f> Non empty sequence containing the elements of the list.

Builds a non empty sequence from the given list.

Throws exception for empty list

list : 'f list

The input list.

Returns: NonEmptySeq<'f>

Non empty sequence containing the elements of the list.

ArgumentException Thrown when the input list is empty.

ofSeq seq

Full Usage: ofSeq seq

Parameters:
    seq : 'i seq - The input sequence.

Returns: NonEmptySeq<'i> Non empty sequence containing the elements of the sequence.

Builds a non empty sequence from the given sequence.

Throws exception for empty sequence. Evaluates the first element of the sequence and may trigger side effects. If you are sure that the sequence is not empty and want to avoid that, you can use `unsafeOfSeq` instead.

seq : 'i seq

The input sequence.

Returns: NonEmptySeq<'i>

Non empty sequence containing the elements of the sequence.

ArgumentException Thrown when the input sequence is empty.

pairwise source

Full Usage: pairwise source

Parameters:
Returns: NonEmptySeq<'a * 'a> The result sequence.

Returns a sequence of each element in the input sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a * 'a>

The result sequence.

permute indexMap source

Full Usage: permute indexMap source

Parameters:
    indexMap : int -> int - The function that maps input indices to output indices.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'a> The result sequence.

Returns a sequence with all elements permuted according to the specified permutation.

Note that this function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences.This function consumes the whole input sequence before yielding the first element of the result sequence.

indexMap : int -> int

The function that maps input indices to output indices.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

ArgumentException Thrown when indexMap does not produce a valid permutation.

readonly source

Full Usage: readonly source

Parameters:
Returns: NonEmptySeq<'a> The result sequence.

Builds a new sequence object that delegates to the given sequence object. This ensures the original sequence cannot be rediscovered and mutated by a type cast. For example, if given an array the returned sequence will return the elements of the array, but you cannot cast the returned sequence object to an array.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

reduce reduction source

Full Usage: reduce reduction source

Parameters:
    reduction : 'T -> 'T -> 'T - The function to reduce two sequence elements to a single element.
    source : 'T seq - The input sequence.

Returns: 'T The final reduced value.

Applies a function to each element of the sequence, threading an accumulator argument through the computation. Apply the function to the first two elements of the sequence. 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 sequence elements to a single element.

source : 'T seq

The input sequence.

Returns: 'T

The final reduced value.

replace oldValue newValue source

Full Usage: replace oldValue newValue source

Parameters:
Returns: NonEmptySeq<'T>
oldValue : NonEmptySeq<'T>
newValue : NonEmptySeq<'T>
source : NonEmptySeq<'T>
Returns: NonEmptySeq<'T>

rev source

Full Usage: rev source

Parameters:
Returns: NonEmptySeq<'a> The reversed sequence.

Returns a new sequence with the elements in reverse order.

This function consumes the whole input sequence before yielding the first element of the reversed sequence.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The reversed sequence.

scan folder state source

Full Usage: scan folder state source

Parameters:
    folder : 'State -> 'T -> 'State - A function that updates the state with each element from the sequence.
    state : 'State - The initial state.
    source : NonEmptySeq<'T> - The input sequence.

Returns: NonEmptySeq<'State> The resulting sequence of computed states.

Like fold, but computes on-demand and returns the sequence of intermediary and final results.

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

A function that updates the state with each element from the sequence.

state : 'State

The initial state.

source : NonEmptySeq<'T>

The input sequence.

Returns: NonEmptySeq<'State>

The resulting sequence of computed states.

scanBack folder source state

Full Usage: scanBack folder source state

Parameters:
    folder : 'T -> 'State -> 'State - A function that updates the state with each element from the sequence.
    source : NonEmptySeq<'T> - The input sequence.
    state : 'State - The initial state.

Returns: NonEmptySeq<'State> The resulting sequence of computed states.

Like foldBack, but returns the sequence of intermediary and final results.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. This function consumes the whole input sequence before yielding the first element of the result sequence.

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

A function that updates the state with each element from the sequence.

source : NonEmptySeq<'T>

The input sequence.

state : 'State

The initial state.

Returns: NonEmptySeq<'State>

The resulting sequence of computed states.

singleton value

Full Usage: singleton value

Parameters:
    value : 'b - The input item.

Returns: NonEmptySeq<'b> The result sequence of one item.

Returns a sequence that yields one item only.

value : 'b

The input item.

Returns: NonEmptySeq<'b>

The result sequence of one item.

sort source

Full Usage: sort source

Parameters:
Returns: NonEmptySeq<'a> The result sequence.

Yields a sequence ordered by keys.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.This function consumes the whole input sequence before yielding the first element of the result sequence.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

sortBy projection source

Full Usage: sortBy projection source

Parameters:
    projection : 'a -> 'b - A function to transform items of the input sequence into comparable keys.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'a> The result sequence.

Applies a key-generating function to each element of a sequence and yield a sequence ordered by keys. The keys are compared using generic comparison as implemented by Operators.compare.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.

projection : 'a -> 'b

A function to transform items of the input sequence into comparable keys.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

sortByDescending projection source

Full Usage: sortByDescending projection source

Parameters:
    projection : 'a -> 'b - A function to transform items of the input sequence into comparable keys.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'a> The result sequence.

Applies a key-generating function to each element of a sequence and yield a sequence ordered descending by keys. The keys are compared using generic comparison as implemented by Operators.compare.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.

projection : 'a -> 'b

A function to transform items of the input sequence into comparable keys.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

sortDescending source

Full Usage: sortDescending source

Parameters:
Returns: NonEmptySeq<'a> The result sequence.

Yields a sequence ordered descending by keys.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

sortWith comparer source

Full Usage: sortWith comparer source

Parameters:
    comparer : 'a -> 'a -> int - The function to compare the collection elements.
    source : NonEmptySeq<'a> - The input sequence.

Returns: NonEmptySeq<'a> The result sequence.

Yields a sequence ordered using the given comparison function.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.This function consumes the whole input sequence before yielding the first element of the result sequence.

comparer : 'a -> 'a -> int

The function to compare the collection elements.

source : NonEmptySeq<'a>

The input sequence.

Returns: NonEmptySeq<'a>

The result sequence.

tail source

Full Usage: tail source

Parameters:
Returns: 'a seq The result sequence.

Returns a sequence that skips 1 element of the underlying sequence and then yields the remaining elements of the sequence.

source : NonEmptySeq<'a>

The input sequence.

Returns: 'a seq

The result sequence.

tryOfArray array

Full Usage: tryOfArray array

Parameters:
    array : 'a[]

Returns: NonEmptySeq<'a> option

Transforms a array to a NonEmptySeq, returning an option to signal when the original array was empty.

array : 'a[]
Returns: NonEmptySeq<'a> option

tryOfList list

Full Usage: tryOfList list

Parameters:
    list : 'a list

Returns: NonEmptySeq<'a> option

Transforms a list to a NonEmptySeq, returning an option to signal when the original list was empty.

list : 'a list
Returns: NonEmptySeq<'a> option

tryOfSeq seq

Full Usage: tryOfSeq seq

Parameters:
    seq : 'a seq

Returns: NonEmptySeq<'a> option

Transforms a sequence to a NonEmptySeq, returning an option to signal when the original sequence was empty.

seq : 'a seq
Returns: NonEmptySeq<'a> option

unfold generator head state

Full Usage: unfold generator head state

Parameters:
    generator : 'T -> 'State -> ('T * 'State) option
    head : 'T
    state : 'State

Returns: NonEmptySeq<'T>
generator : 'T -> 'State -> ('T * 'State) option
head : 'T
state : 'State
Returns: NonEmptySeq<'T>

unsafeOfSeq seq

Full Usage: unsafeOfSeq seq

Parameters:
    seq : 'c seq - The input sequence.

Returns: NonEmptySeq<'c> Non empty sequence containing the elements of the original sequence.

Builds a non empty sequence from the given sequence.

**This function does not check whether the sequence is actually non empty or not.** Use this function only if you are sure that the sequence is not empty and you don't want to evaluate the first element of the sequence which would cause a side effect. Otherwise, always use `ofSeq`.

seq : 'c seq

The input sequence.

Returns: NonEmptySeq<'c>

Non empty sequence containing the elements of the original sequence.

zip source1 source2

Full Usage: zip source1 source2

Parameters:
    source1 : NonEmptySeq<'a> - The first input sequence.
    source2 : NonEmptySeq<'b> - The second input sequence.

Returns: NonEmptySeq<'a * 'b> The result sequence.

Combines the two sequences into a sequence of pairs. The two sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequence are ignored.

source1 : NonEmptySeq<'a>

The first input sequence.

source2 : NonEmptySeq<'b>

The second input sequence.

Returns: NonEmptySeq<'a * 'b>

The result sequence.

zip3 source1 source2 source3

Full Usage: zip3 source1 source2 source3

Parameters:
Returns: NonEmptySeq<'a * 'b * 'c> The result sequence.

Combines the three sequences into a sequence of triples. The sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequences are ignored.

source1 : NonEmptySeq<'a>

The first input sequence.

source2 : NonEmptySeq<'b>

The second input sequence.

source3 : NonEmptySeq<'c>

The third input sequence.

Returns: NonEmptySeq<'a * 'b * 'c>

The result sequence.