Yaaf.FSharp.Helper


Seq

Defined in Yaaf.FSharp.Helper.dll.

Extensions for F#'s Seq module.

Functions and values

Function or valueDescription
asCircular values
Signature: values:seq<'?22950> -> seq<'?22950>
Type parameters: '?22950

Creates a infinite sequences of the given values

asCircularOnLoop f values
Signature: f:(unit -> unit) -> values:seq<'?22952> -> seq<'?22952>
Type parameters: '?22952

Creates a infinite sequences of the given values, executing the given function everytime the given seq is exhausted

asCircularWithBreak values
Signature: values:seq<'?22954> -> seq<'?22954 option>
Type parameters: '?22954

Creates a infinite sequences of the given values returning None everytime the given seq is exhausted

combine f a b
Signature: f:('?22970 -> '?22971 -> '?22972) -> a:seq<'?22970> -> b:seq<'?22971> -> seq<'?22972>
Type parameters: '?22970, '?22971, '?22972

Creates a new collection whose elements are the results of applying the given function to the corresponding pairs of elements from the two sequences. Unlike Seq.map2, if one input sequence is shorter than the other then the remaining elements of the longer sequence are not ignored, they are yielded at the end of the resulting sequence.

contract n source
Signature: n:int -> source:seq<'?22968> -> seq<'?22968>
Type parameters: '?22968

Contracts a seq selecting every n values

grow n
Signature: n:int -> seq<'?22974> -> seq<'?22974>
Type parameters: '?22974

Replicates each element in the seq n-times

index a
Signature: a:seq<'?22933> -> seq<int * '?22933>
Type parameters: '?22933

Adds an index to a sequence

intersperse sep list
Signature: sep:'a -> list:seq<'a> -> seq<'a>
Type parameters: 'a
iterBreak f seq
Signature: f:('T -> bool) -> seq:seq<'T> -> unit
Type parameters: 'T

Will iterate the current sequence until the given predicate is statisfied

lift2 f l1 l2
Signature: f:('?22937 -> '?22938 -> '?22939) -> l1:seq<'?22937> -> l2:seq<'?22938> -> seq<'?22939>
Type parameters: '?22937, '?22938, '?22939
ofStreamByByte stream
Signature: stream:Stream -> seq<int>

Converts a Stream into a sequence of bytes

ofStreamByChunk chunkSize stream
Signature: chunkSize:int -> stream:Stream -> seq<byte []>

Converts a stream into a seq of byte[] where the array is of the length given Note: the last chunk maybe less than the given chunk size

ofStreamReader streamReader
Signature: streamReader:StreamReader -> seq<string>

Converts a streamReader into a seq yielding on each line

page page pageSize source
Signature: page:int -> pageSize:int -> source:seq<'?22976> -> seq<'?22976>
Type parameters: '?22976

Pages the underlying sequence

prependToAll sep list
Signature: sep:'?22978 -> list:seq<'?22978> -> seq<'?22978>
Type parameters: '?22978
repeat a
Signature: a:'?22966 -> seq<'?22966>
Type parameters: '?22966

Creates an infinite sequence of the given value

skipNoFail count source
Signature: count:int -> source:seq<'?22964> -> IEnumerable<'?22964>
Type parameters: '?22964

The same as Seq.skip except it returns empty if the sequence is empty or does not have enough elements. Alias for Enumerable.Skip

splitAt n seq
Signature: n:int -> seq:seq<'?22945> -> seq<'?22945> * seq<'?22945>
Type parameters: '?22945

Splits a sequences at the given index

tail source
Signature: source:seq<'?22958> -> seq<'?22958>
Type parameters: '?22958
tailNoFail source
Signature: source:seq<'?22960> -> seq<'?22960>
Type parameters: '?22960
tryAverage seq
Signature: seq:seq<^a> -> ^a option
Type parameters: ^a

The same as Seq.average except will return None if the seq is empty

tryFindWithIndex pred l
Signature: pred:('?22935 -> bool) -> l:seq<'?22935> -> (int * '?22935) option
Type parameters: '?22935

Returns the first element (with its index) for which the given function returns true. Return None if no such element exists.

tryHead source
Signature: source:seq<'c> -> 'c option
Type parameters: 'c

A safe version of seq head

tryNth index source
Signature: index:int -> source:seq<'?22962> -> '?22962 option
Type parameters: '?22962

The same as Seq.nth except returns None if the sequence is empty or does not have enough elements

Fork me on GitHub