Arr<A> Struct

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.

DECLARATION
[Serializable]
public struct Arr<A> : IEnumerable<A>,
IReadOnlyList<A>,
IReadOnlyCollection<A>
NAMESPACE
LanguageExt

Constructors

Arr(IEnumerable<A>)
SUMMARY

Ctor

PARAMETERS
initial
IEnumerable<A>
DECLARATION
public ctor Arr(IEnumerable<A> initial)

Fields

Empty
SUMMARY

Empty array

DECLARATION
public static readonly Arr<A> Empty

Properties

Count
SUMMARY

Number of items in the array

DECLARATION
[Pure]
public int Count { get; }
RETURNS
int
IsEmpty
DECLARATION
[Pure]
public bool IsEmpty { get; }
RETURNS
bool
this
SUMMARY

Index accessor

DECLARATION
[Pure]
public A this [int index] { get; }
RETURNS
A

Methods

Add(A)
SUMMARY

Add an item to the end of the array

PARAMETERS
value
A
DECLARATION
[Pure]
public Arr<A> Add(A value)
RETURNS
Arr<A>
AddRange(IEnumerable<A>)
SUMMARY

Add a range of items to the end of the array

PARAMETERS
items
IEnumerable<A>
DECLARATION
[Pure]
public Arr<A> AddRange(IEnumerable<A> items)
RETURNS
Arr<A>
Append(Arr<A>)
PARAMETERS
rhs
Arr<A>
DECLARATION
[Pure]
public Arr<A> Append(Arr<A> rhs)
RETURNS
Arr<A>
Clear()
SUMMARY

Clear the array

DECLARATION
[Pure]
public Arr<A> Clear()
RETURNS
Arr<A>
Equals(object)
PARAMETERS
obj
object
DECLARATION
[Pure]
public override bool Equals(object obj)
RETURNS
bool
Equals(Lst<A>)
PARAMETERS
other
Lst<A>
DECLARATION
[Pure]
public bool Equals(Lst<A> other)
RETURNS
bool
Filter(Func<A, bool>)
SUMMARY

Filter

PARAMETERS
pred
Func<A, bool>
DECLARATION
[Pure]
public Arr<A> Filter(Func<A, bool> pred)
RETURNS
Arr<A>
Fold<S>(S, Func<S, A, S>)
SUMMARY

Fold

PARAMETERS
state
S
folder
Func<S, A, S>
DECLARATION
[Pure]
public S Fold<S>(S state, Func<S, A, S> folder)
RETURNS
S
GetEnumerator()
SUMMARY

Get enumerator

DECLARATION
[Pure]
public IEnumerator<A> GetEnumerator()
RETURNS
IEnumerator<A>
GetHashCode()
SUMMARY

Get the hash code Lazily (and once only) calculates the hash from the elements in the array Empty array hash == 0

DECLARATION
[Pure]
public override int GetHashCode()
RETURNS
int
IndexOf(A, int, int, IEqualityComparer<A>)
SUMMARY

Find the index of an item

PARAMETERS
item
A
index
int
count
int
equalityComparer
IEqualityComparer<A>
DECLARATION
[Pure]
public int IndexOf(A item, int index = 0, int count = -1, IEqualityComparer<A> equalityComparer = null)
RETURNS
int
IndexOf<EQ>(A, int, int)
SUMMARY

Find the index of an item

PARAMETERS
item
A
index
int
count
int
DECLARATION
[Pure]
public int IndexOf<EQ>(A item, int index = 0, int count = -1)
RETURNS
int
CONSTRAINTS
where EQ : struct Eq<A>
Insert(int, A)
SUMMARY

Insert value at specified index

PARAMETERS
index
int
value
A
DECLARATION
[Pure]
public Arr<A> Insert(int index, A value)
RETURNS
Arr<A>
InsertRange(int, IEnumerable<A>)
SUMMARY

Insert range of values at specified index

PARAMETERS
index
int
items
IEnumerable<A>
DECLARATION
[Pure]
public Arr<A> InsertRange(int index, IEnumerable<A> items)
RETURNS
Arr<A>
LastIndexOf(A, int, int, IEqualityComparer<A>)
SUMMARY

Find the index of an item

PARAMETERS
item
A
index
int
count
int
equalityComparer
IEqualityComparer<A>
DECLARATION
[Pure]
public int LastIndexOf(A item, int index = -1, int count = -1, IEqualityComparer<A> equalityComparer = null)
RETURNS
int
LastIndexOf<EQ>(A, int, int)
SUMMARY

Find the index of an item

PARAMETERS
item
A
index
int
count
int
DECLARATION
[Pure]
public int LastIndexOf<EQ>(A item, int index = -1, int count = -1)
RETURNS
int
CONSTRAINTS
where EQ : struct Eq<A>
Map<B>(Func<A, B>)
SUMMARY

Map

PARAMETERS
map
Func<A, B>
DECLARATION
[Pure]
public Arr<B> Map<B>(Func<A, B> map)
RETURNS
Arr<B>
Remove(A)
SUMMARY

Remove an item from the array

PARAMETERS
value
A
DECLARATION
[Pure]
public Arr<A> Remove(A value)
RETURNS
Arr<A>
Remove(A, IEqualityComparer<A>)
SUMMARY

Remove an item from the array

PARAMETERS
value
A
equalityComparer
IEqualityComparer<A>
DECLARATION
[Pure]
public Arr<A> Remove(A value, IEqualityComparer<A> equalityComparer)
RETURNS
Arr<A>
Remove<EQ>(A)
SUMMARY

Remove an item from the array

PARAMETERS
value
A
DECLARATION
[Pure]
public Arr<A> Remove<EQ>(A value)
RETURNS
Arr<A>
CONSTRAINTS
where EQ : struct Eq<A>
RemoveAll(Predicate<A>)
SUMMARY

Remove all items that match a predicate

PARAMETERS
pred
Predicate<A>
DECLARATION
[Pure]
public Arr<A> RemoveAll(Predicate<A> pred)
RETURNS
Arr<A>
RemoveAt(int)
SUMMARY

Remove item at location

PARAMETERS
index
int
DECLARATION
[Pure]
public Arr<A> RemoveAt(int index)
RETURNS
Arr<A>
RemoveRange(int, int)
SUMMARY

Remove a range of items

PARAMETERS
index
int
count
int
DECLARATION
[Pure]
public Arr<A> RemoveRange(int index, int count)
RETURNS
Arr<A>
Reverse()
SUMMARY

Reverse the order of the items in the array

DECLARATION
[Pure]
public Arr<A> Reverse()
RETURNS
Arr<A>
SetItem(int, A)
SUMMARY

Set an item at the specified index

PARAMETERS
index
int
value
A
DECLARATION
[Pure]
public Arr<A> SetItem(int index, A value)
RETURNS
Arr<A>
Skip(int)
PARAMETERS
amount
int
DECLARATION
[Pure]
public IEnumerable<A> Skip(int amount)
RETURNS
IEnumerable<A>