Lst<A> Struct

Immutable list

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

Constructors

Lst(IEnumerable<A>)
SUMMARY

Ctor

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

Fields

Empty
SUMMARY

Empty list

DECLARATION
public static readonly Lst<A> Empty

Properties

Count
SUMMARY

Number of items in the list

DECLARATION
[Pure]
public int Count { get; }
RETURNS
int
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 list

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

Add a range of items to the end of the list

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

Clear the list

DECLARATION
[Pure]
public Lst<A> Clear()
RETURNS
Lst<A>
Contains(A)
SUMMARY

Find if a value is in the collection

PARAMETERS
value
A
Value to test
DECLARATION
[Pure]
public bool Contains(A value)
RETURNS
bool
True if collection contains value
Contains<EqA>(A)
SUMMARY

Contains with provided Eq class instance

PARAMETERS
value
A
Value to test
DECLARATION
[Pure]
public bool Contains<EqA>(A value)
RETURNS
bool
True if collection contains value
CONSTRAINTS
where EqA : struct Eq<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 Lst<A> Filter(Func<A, bool> pred)
RETURNS
Lst<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 list Empty list 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
Insert(int, A)
SUMMARY

Insert value at specified index

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

Insert range of values at specified index

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

Find the last index of an item in the list

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

Map

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

Remove an item from the list

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

Remove an item from the list

PARAMETERS
value
A
equalityComparer
IComparer<A>
DECLARATION
[Pure]
public Lst<A> Remove(A value, IComparer<A> equalityComparer)
RETURNS
Lst<A>
RemoveAll(Predicate<A>)
SUMMARY

Remove all items that match a predicate

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

Remove item at location

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

Remove a range of items

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

Reverse the order of the items in the list

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

Set an item at the specified index

PARAMETERS
index
int
value
A
DECLARATION
[Pure]
public Lst<A> SetItem(int index, A value)
RETURNS
Lst<A>
Skip(int)
PARAMETERS
amount
int
DECLARATION
[Pure]
public IEnumerable<A> Skip(int amount)
RETURNS
IEnumerable<A>
Subtract(Lst<A>)
PARAMETERS
rhs
Lst<A>
DECLARATION
[Pure]
public Lst<A> Subtract(Lst<A> rhs)
RETURNS
Lst<A>
ToArray()
DECLARATION
[Pure]
public Arr<A> ToArray()
RETURNS
Arr<A>
ToSeq()
DECLARATION
[Pure]
public Seq<A> ToSeq()
RETURNS
Seq<A>