- Arr <A>
- Empty
- Arr (IEnumerable<A> initial)
- Arr (ReadOnlySpan<A> initial)
- AsStream <M> ()
- AsSpan ()
- AsSpan (int start, int length)
- head
- headOrNone
- last
- lastOrNone
- item (int index)
- itemOrNone (int index)
- map <B> (Lens<A, B> lens)
- this []
- Case
- IsEmpty
- Count
- Length
- Add (A valueToAdd)
- AddRange (IEnumerable<A> items)
- Clear ()
- GetEnumerator ()
- IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A>? equalityComparer = null)
- LastIndexOf (A item, int index = -1, int count = -1, IEqualityComparer<A>? equalityComparer = null)
- IndexOf <EQ> (A item, int index = 0, int count = -1)
- LastIndexOf <EQ> (A item, int index = -1, int count = -1)
- Insert (int index, A valueToInsert)
- InsertRange (int index, IEnumerable<A> items)
- Remove (A valueToRemove)
- Remove (A valueToRemove, IEqualityComparer<A> equalityComparer)
- Remove <EQ> (A valueToRemove)
- RemoveAll (Predicate<A> pred)
- RemoveAt (int index)
- RemoveRange (int index, int count)
- SetItem (int index, A valueToSet)
- AsIterable ()
- ToSeq ()
- ToString ()
- ToFullString (string separator = ", ")
- ToFullArrayString (string separator = ", ")
- Skip (int amount)
- Reverse ()
- Do (Action<A> f)
- Map <B> (Func<A, B> map)
- Traverse <F, B> (Func<A, K<F, B>> f)
- TraverseM <M, B> (Func<A, K<M, B>> f)
- Filter (Func<A, bool> pred)
- + (Arr<A> lhs, A rhs)
- + (A lhs, Arr<A> rhs)
- + (Arr<A> lhs, Arr<A> rhs)
- | (Arr<A> x, K<Arr, A> y)
- | (K<Arr, A> x, Arr<A> y)
- Combine (Arr<A> rhs)
- Equals (object? obj)
- GetHashCode ()
- CompareTo (object? obj)
- Equals (Arr<A> other)
- CompareTo (Arr<A> other)
- == (Arr<A> lhs, Arr<A> rhs)
- != (Arr<A> lhs, Arr<A> rhs)
- Bind <B> (Func<A, Arr<B>> f)
- > (Arr<A> left, Arr<A> right)
- >= (Arr<A> left, Arr<A> right)
- < (Arr<A> left, Arr<A> right)
- <= (Arr<A> left, Arr<A> right)
- AdditiveIdentity
- Enumerator
- ArrExtensions
- As <A> (this K<Arr, A> xs)
- Flatten <A> (this A[][] ma)
- Flatten <A> (this Arr<Arr<A>> ma)
- Filter <A> (this Arr<A> ma, Func<A, bool> f)
- Where <A> (this Arr<A> ma, Func<A, bool> f)
- Map <A, B> (this Arr<A> ma, Func<A, B> f)
- Select <A, B> (this Arr<A> ma, Func<A, B> f)
- Bind <A, B> (this Arr<A> ma, Func<A, Arr<B>> f)
- SelectMany <A, B> (this Arr<A> ma, Func<A, Arr<B>> f)
- SelectMany <A, B, C> (this Arr<A> ma, Func<A, Arr<B>> bind, Func<A, B, C> project)
- AsQueryable <A> (this Arr<A> source)
- ArrExtensions
- Map <A, B> (this Func<A, B> f, K<Arr, A> ma)
- Map <A, B> (this Func<A, B> f, Arr<A> ma)
- Action <A, B> (this Arr<A> ma, K<Arr, B> mb)
- Action <A, B> (this K<Arr, A> ma, K<Arr, B> mb)
- Apply <A, B> (this Arr<Func<A, B>> mf, K<Arr, A> ma)
- Apply <A, B> (this K<Arr, Func<A, B>> mf, K<Arr, A> ma)
- Arr
- empty <T> ()
- create <T> ()
- singleton <A> (A value)
- create <T> (ReadOnlySpan<T> items)
- create <T> (params T[] items)
- createRange <T> (IEnumerable<T> items)
- add <T> (Arr<T> array, T value)
- addRange <T> (Arr<T> array, IEnumerable<T> value)
- remove <T> (Arr<T> array, T value)
- removeAt <T> (Arr<T> array, int index)
- rev <T> (T[] array)
- rev <T> (Arr<T> array)
- flatten <A> (A[][] ma)
- flatten <A> (Arr<Arr<A>> ma)
- Arr
- Prelude
Immutable array Native array O(1) read performance. Modifications require copying of the entire array to generate the newly mutated version. This is will be very expensive for large arrays.
type | A | Value type |
property Lens<Arr<A>, Option<A>> headOrNone Source #
Head or none lens
property Lens<Arr<A>, Option<A>> lastOrNone Source #
Last or none lens
property object? Case Source #
Reference version for use in pattern-matching
Empty collection = result is null
Singleton collection = result is A
More = result is (A, Seq<A>) -- head and tail
Example:
var res = arr.Case switch
{
A value => ...,
(var x, var xs) => ...,
_ => ...
}
property Arr<A> AdditiveIdentity Source #
method Lens<Arr<A>, Option<A>> itemOrNone (int index) Source #
Item or none at index lens
method Enumerator GetEnumerator () Source #
Get enumerator
method int IndexOf (A item, int index = 0, int count = -1, IEqualityComparer<A>? equalityComparer = null) Source #
Find the index of an item
method int LastIndexOf (A item, int index = -1, int count = -1, IEqualityComparer<A>? equalityComparer = null) Source #
Find the index of an item
method int IndexOf <EQ> (A item, int index = 0, int count = -1) Source #
Find the index of an item
method int LastIndexOf <EQ> (A item, int index = -1, int count = -1) Source #
Find the index of an item
method Arr<A> InsertRange (int index, IEnumerable<A> items) Source #
Insert range of values at specified index
method Arr<A> Remove (A valueToRemove, IEqualityComparer<A> equalityComparer) Source #
Remove an item from the array
method Arr<A> RemoveRange (int index, int count) Source #
Remove a range of items
method Iterable<A> AsIterable () Source #
method string ToString () Source #
Format the collection as [a, b, c, ...]
The ellipsis is used for collections over 50 items
To get a formatted string with all the items, use ToFullString
or ToFullArrayString
.
method string ToFullString (string separator = ", ") Source #
Format the collection as a, b, c, ...
method string ToFullArrayString (string separator = ", ") Source #
Format the collection as [a, b, c, ...]
method Arr<A> Do (Action<A> f) Source #
Impure iteration of the bound values in the structure
returns | Returns the original unmodified structure |
method K<F, Arr<B>> Traverse <F, B> (Func<A, K<F, B>> f) Source #
Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.
type | F | Applicative functor trait |
type | B | Bound value (output) |
param | f | |
param | ta | Traversable structure |
method K<M, Arr<B>> TraverseM <M, B> (Func<A, K<M, B>> f) Source #
Map each element of a structure to an action, evaluate these actions from left to right, and collect the results.
type | M | Monad trait |
type | B | Bound value (output) |
param | f | |
param | ta | Traversable structure |
method int GetHashCode () Source #
Get the hash code Lazily (and once only) calculates the hash from the elements in the array Empty array hash == 0
class ArrExtensions Source #
method Arr<B> SelectMany <A, B> (this Arr<A> ma, Func<A, Arr<B>> f) Source #
method Arr<C> SelectMany <A, B, C> (this Arr<A> ma, Func<A, Arr<B>> bind, Func<A, B, C> project) Source #
method IQueryable<A> AsQueryable <A> (this Arr<A> source) Source #
Convert to a queryable
class ArrExtensions Source #
method Arr<B> Map <A, B> (this Func<A, B> f, K<Arr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Arr<B> Map <A, B> (this Func<A, B> f, Arr<A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Arr<B> Action <A, B> (this Arr<A> ma, K<Arr, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Arr<B> Action <A, B> (this K<Arr, A> ma, K<Arr, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Arr<B> Apply <A, B> (this Arr<Func<A, B>> mf, K<Arr, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
method Arr<B> Apply <A, B> (this K<Arr, Func<A, B>> mf, K<Arr, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |
method Arr<A> singleton <A> (A value) Source #
Create a singleton array
param | value | Single value |
returns | Collection with a single item in it |
method Arr<T> create <T> (ReadOnlySpan<T> items) Source #
Create an array from a initial set of items
param | items | Items |
returns | Lst T |
method Arr<T> create <T> (params T[] items) Source #
Create an array from a initial set of items
param | items | Items |
returns | Lst T |
method Arr<T> createRange <T> (IEnumerable<T> items) Source #
Create an array from an initial set of items
param | items | Items |
returns | Lst T |
method Arr<T> add <T> (Arr<T> array, T value) Source #
Add an item to the array
param | array | Array |
param | value | Item to add |
returns | A new Lst T |
method Arr<T> addRange <T> (Arr<T> array, IEnumerable<T> value) Source #
Add a range of items to the array
param | array | Array |
param | value | Items to add |
returns | A new Lst T |
method Arr<T> remove <T> (Arr<T> array, T value) Source #
Remove an item from the array
param | array | Array |
param | value | value to remove |
returns | A new Lst T |
method Arr<T> removeAt <T> (Arr<T> array, int index) Source #
Remove an item at a specified index in the array
param | array | Array |
param | index | Index of item to remove |
returns | A new Lst T |
method T[] rev <T> (T[] array) Source #
Reverses the array (Reverse in LINQ)
type | T | Array item type |
param | array | Array to reverse |
returns | Reversed list |
method Arr<B> map <A, B> (Func<A, B> f, K<Arr, A> ma) Source #
Functor map operation
Unwraps the value within the functor, passes it to the map function f
provided, and
then takes the mapped value and wraps it back up into a new functor.
param | ma | Functor to map |
param | f | Mapping function |
returns | Mapped functor |
method Arr<B> action <A, B> (K<Arr, A> ma, K<Arr, B> mb) Source #
Applicative action: runs the first applicative, ignores the result, and returns the second applicative
method Arr<B> apply <A, B> (K<Arr, Func<A, B>> mf, K<Arr, A> ma) Source #
Applicative functor apply operation
Unwraps the value within the ma
applicative-functor, passes it to the unwrapped function(s) within mf
, and
then takes the resulting value and wraps it back up into a new applicative-functor.
param | ma | Value(s) applicative functor |
param | mf | Mapping function(s) |
returns | Mapped applicative functor |