Skip to content

Latest commit

 

History

History
159 lines (136 loc) · 4.28 KB

general.md

File metadata and controls

159 lines (136 loc) · 4.28 KB

General

Sources

{{#template ../../../templates/toolshed-command-head.md name=iota typesig=T -> IEnumerable where T: INumber }} Returns 1..N

{{#template ../../../templates/toolshed-command-head.md name=to <dest> typesig=T -> IEnumerable where T: INumber }} Returns N..M

Filters

{{#template ../../../templates/toolshed-command-head.md name=where <block (T -> bool)> typesig=IEnumerable -> IEnumerable }} Filters the input by the provided code block.

{{#template ../../../templates/toolshed-command-head.md name=unique typesig=IEnumerable -> IEnumerable }} Filters the input by uniqueness, eliminating duplicate values.

{{#template ../../../templates/toolshed-command-head.md name=take <amount> typesig=IEnumerable -> IEnumerable }} Removes N values from the input, discarding the rest.

{{#template ../../../templates/toolshed-command-head.md name=select <quantity> typesig=IEnumerable -> IEnumerable }} Removes a quantity (amount or percentage) of values from the input randomly, discarding the rest.

{{#template ../../../templates/toolshed-command-head.md name=sort typesig=IEnumerable -> IEnumerable }} Sorts the input from least to greatest.

{{#template ../../../templates/toolshed-command-head.md name=sortby <block (T -> TOrd)> typesig=IEnumerable -> IEnumerable }} Sorts the input from least to greatest using the given ordering value.

    entities sortby { allcomps count }

{{#template ../../../templates/toolshed-command-head.md name=sortmapby <block (T -> TOrd)> typesig=IEnumerable -> IEnumerable }} Sorts the input from least to greatest using the given ordering value, returning the ordering values.

{{#template ../../../templates/toolshed-command-head.md name=sortdown typesig=IEnumerable -> IEnumerable }} Sorts the input from greatest to least.

{{#template ../../../templates/toolshed-command-head.md name=sortdownby <block (T -> TOrd)> typesig=IEnumerable -> IEnumerable }} Sorts the input from greatest to least using the given ordering value.

{{#template ../../../templates/toolshed-command-head.md name=sortmapdownby <block (T -> TOrd)> typesig=IEnumerable -> IEnumerable }} Sorts the input from greatest to least using the given ordering value, returning the ordering values.

Transforms

{{#template ../../../templates/toolshed-command-head.md name=isempty typesig=IEnumerable -> bool }} Returns true if the input is empty, otherwise false. This command can be inverted with not.

{{#template ../../../templates/toolshed-command-head.md name=isnull typesig=object? -> bool }} Returns true if the input is null, otherwise false. This command can be inverted with not.

{{#template ../../../templates/toolshed-command-head.md name=count typesig=IEnumerable -> int }} Counts the number of values in the input.

{{#template ../../../templates/toolshed-command-head.md name=iterate <block (T -> T)> <times> typesig=IEnumerable -> IEnumerable }} Repeats the given code block N times over it's own output, effectively f(f(...N f(x)))

{{#template ../../../templates/toolshed-command-head.md name=first typesig=IEnumerable -> T }} Returns the first value in the input, or errors if there isn't one.

Mutators

{{#template ../../../templates/toolshed-command-head.md name=rep <amount> typesig=T -> IEnumerable }} Repeats the input value N times.

{{#template ../../../templates/toolshed-command-head.md name=bin typesig=IEnumerable -> IDictionary<T, int> }} Counts the number of times each unique instance of T occurs in the input, returning a dictionary of unique instance : count.

{{#template ../../../templates/toolshed-command-head.md name=map <block (TIn -> TOut)> typesig=IEnumerable -> IEnumerable }} Applies the given code block to each element of the input.

{{#template ../../../templates/toolshed-command-head.md name=reduce <block (T -> T)> typesig=IEnumerable -> T }} Reduces the input, effectively f(x1, f(x2, ...f(xn-1, xn)))